Keypad kullanimi

Dependencies:   mbed mbed-rtos MFRC522 TextLCD keypad

main.cpp

Committer:
marvas
Date:
2019-10-09
Revision:
0:66860685087d
Child:
1:2fd11c224867

File content as of revision 0:66860685087d:

  #include "mbed.h"
  #include "Keypad.h"
 
Keypad key(PC_4, PB_13, PB_14, PB_15, PB_1, PB_2, PB_12, PA_11);
 
 char key_table[] = { 
                      '1', '2', '3', 'A',
                      '4', '5', '6', 'B',
                      '7', '8', '9', 'C',
                      '*', '0', '#', 'D'
                    };
   Serial pc(USBTX,USBRX);    
  int main() {
      pc.baud(250000);
      uint32_t key_num;
      while(true) {
         while ((key_num = key.read()) != 0){
             pc.printf("%c\r\n", *(key_table + key_num-1));
         }
        
     }
 }