amny

Untitled

Jun 17th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. #include <LiquidCrystal.h> //Dołączenie bilbioteki
  2. #include <Keypad.h>
  3.  
  4. LiquidCrystal lcd(0, 1, 10,11,12,13); //Informacja o podłączeniu nowego wyświetlacza
  5.  
  6. const byte ROWS = 2;
  7. const byte COLS = 4;
  8. char keys[ROWS][COLS]={
  9. {'t','n','u','y'}, //
  10. {'e','r','d','l'}
  11. };
  12.  
  13. byte rowPins[ROWS] = {7,8};
  14. byte colPins[COLS] = {3,4,5,6};
  15.  
  16. typedef struct{
  17. char nazwa[16];
  18. char numer[9];
  19. } ksiazka;
  20.  
  21. byte licznik=0;
  22. ksiazka osoby[20];
  23. tryb = 0; //tryby: 0-wpisz osobe, 1-przegladaj
  24.  
  25. Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS);
  26.  
  27.  
  28. void setup() {
  29. lcd.begin(16, 2); // put your LCD parameters here
  30. lcd.setCursor(0, 0); //Ustawienie kursora
  31. lcd.print("Kurs Arduino"); //Wyświetlenie tekstu
  32. lcd.setCursor(0, 1); //Ustawienie kursora
  33. lcd.print("Na Forbocie!"); //Wyświetlenie tekstu
  34. lcd.blink(); //Włącznie kursora
  35. }
  36.  
  37. void loop() {
  38. char key = kpd.getKey();
  39. if (tryb==0){
  40. if(key) // Check for a valid key.
  41. {
  42. switch (key)
  43. {
  44.  
  45. default:
  46. lcd.setCursor(0, 0); //Ustawienie kursora
  47. lcd.print("doot"); //Wyświetlenie tekstu
  48. }
  49. }
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment