Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Keypad.h"
- #include <Wire.h>
- #include <LiquidCrystal_I2C.h>
- LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display
- const byte ROWS = 4; //four rows
- const byte COLS = 4; //three columns
- char keys[ROWS][COLS] = {
- {'1','2','3' , 'A'},
- {'4','5','6' , 'B'},
- {'7','8','9' , 'C'},
- {'*','0','#' , 'D'}
- };
- byte rowPins[ROWS] = {2, 3, 4, 5}; //Piny, do których podłączamy wyprowadzenia od rzędów
- byte colPins[COLS] = {6, 7, 8 , 9}; //Piny, do których kolumn wyprowadzenia od rzędów
- Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
- void setup(){
- Serial.begin(9600);
- lcd.init(); // initialize the lcd
- lcd.init();
- lcd.backlight();
- }
- void loop(){
- char key = keypad.getKey();
- for(;;)
- {
- Serial.println("Aspekt pierwszy");
- lcd.setCursor(0,0);
- lcd.print("Witaj w KXFACTOR");
- lcd.setCursor(1,1);
- lcd.print("Siłka");
- if (key == '3')
- {
- break;
- }
- }
- Serial.println("DRUGOOOOOO");
- lcd.setCursor(0,0);
- lcd.print("CISZAAA");
- lcd.setCursor(1,1);
- lcd.print("MATEMATYKA");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement