//craeate code programming c++
//Setup อุปกรณ์ แป้นกดตัวเลข
#include <Keypad.h>
//แสดงจำนวนแถว แนวตั้ง แนวนอน
const int8_t ROW = 4;
const int8_t COL = 4;
// ตาราง ค่าตัวแปร Keyword
char topic[ROW][COL] ={
{ '1' , '2' , '3' , 'A' },
{ '4' , '5' , '6' , 'B' },
{ '7' , '8' , '9' , 'C' },
{ '*' , '0' , '#' , 'D'}
};
// กำหนดช่อง pin ที่ต้องการ ต่อกับ Microcontroller
uint8_t pinCOL[COL] ={ 5 , 4 , 3 , 2 };
uint8_t PinROW[ROW] ={ 9 , 8 , 7 , 6 };
Keypad keypad = ;
void setup() {
Serial.begin(9600);
}
void loop() {
char key = Keypad.getKey();
if (key != NO_KEY) {
Serial.println(key);
}
}