Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <LiquidCrystal.h> //Dołączenie bilbioteki
- #include <Keypad.h>
- LiquidCrystal lcd(0, 1, 10,11,12,13); //Informacja o podłączeniu nowego wyświetlacza
- const byte ROWS = 2;
- const byte COLS = 4;
- char keys[ROWS][COLS]={
- {'t','n','u','y'}, //
- {'e','r','d','l'}
- };
- byte rowPins[ROWS] = {7,8};
- byte colPins[COLS] = {3,4,5,6};
- typedef struct{
- char nazwa[16];
- char numer[9];
- } ksiazka;
- byte licznik=0;
- ksiazka osoby[20];
- tryb = 0; //tryby: 0-wpisz osobe, 1-przegladaj
- Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS);
- void setup() {
- lcd.begin(16, 2); // put your LCD parameters here
- lcd.setCursor(0, 0); //Ustawienie kursora
- lcd.print("Kurs Arduino"); //Wyświetlenie tekstu
- lcd.setCursor(0, 1); //Ustawienie kursora
- lcd.print("Na Forbocie!"); //Wyświetlenie tekstu
- lcd.blink(); //Włącznie kursora
- }
- void loop() {
- char key = kpd.getKey();
- if (tryb==0){
- if(key) // Check for a valid key.
- {
- switch (key)
- {
- default:
- lcd.setCursor(0, 0); //Ustawienie kursora
- lcd.print("doot"); //Wyświetlenie tekstu
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment