void ResetOutputPins(uint16_t pins) { ODR &= pins ^ 0xFF; showLeds(); }
void InitOutputPins(void) { showLeds(); }
void SetOutputPins(uint16_t pins) { ODR |= pins; showLeds(); }
void loop() { static int8_t value=0; uint8_t n; // blink LED for(n=0; n<3; n++) { ledOn(); delay(200); ledOff(); delay(200); } uint8_t row,col; // display row an colun test initDisplay(); for(row=0; row<5; row++) { for(col=0; col<7; col++) { setRow(row); setCol(col); delay(100); } } // show hello _putchar('H'); showMatrix(200); _putchar('E'); showMatrix(200); _putchar('L'); showMatrix(400); _putchar('O'); showMatrix(200); //**************** key display example *************************** do { n=_getchar(); value=getKey(); _putchar(n); showLeds(value); } while(n!='i'); //**************** key sound display example *************************** tone(CH2_SPEAKERPIN, frequencyTable[0],50); do { n=_getchar(); value=getKey(); tone(CH2_SPEAKERPIN, frequencyTable[value],50); delay(50); _putchar(n); showLeds(value); } while(n!='i'); // key code test do { n=scanKey(); //initDisplay(); //setCol(0); //setRowPattern(n); if(n<0x10) hex1(n); else _putchar('n'); showLeds(n); showMatrix(100); //delay(1000); } while(n!=HASHKEY); }