Stap 4: De Code;
#include < liquidCrystal.h >
#include < Keypad.h >
#include < Wire.h >
Const byte rijen = 4;
Const byte cols = 3;
char toetsen [rows] [cols] = {}
{'1', '2','3 '},
{'4', '5','6 '},
{'7', '8','9 '},
{'*','0','#'}
};
byte rowPins [rows] = {13,10,9,8};
byte colPins [cols] = {7,6,1};
Toetsenblok keypad=Keypad(makeKeymap(keys),rowPins,colPins,rows,cols);
LiquidCrystal Lcd(12,11,5,4,3,2);
VOID Setup {}
LCD.begin(16,2);
Lcd.setCursor(1,0);
LCD.Print ("druk op een nummer");
Zet uw setup-code hier, om het eenmalig uit te voeren:
}
void loop {}
char key=keypad.getKey();
if(int(Key)!=0)
{
Lcd.setCursor(5,1);
LCD.Print(Key);
}
}