Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Keypad.h>
- #include <Servo.h>
- #include <LiquidCrystal.h>
- int Open = 90;
- int Close = 0;
- int a = 0, b = 0, c = 0, d = 0;
- int var = 0;
- const int C1=5, C2=6, C3=8, C4=0;
- char f='*';
- //Клавіатура
- const int rows = 4;
- const int cols = 3;
- char keys[rows][cols]=
- {
- {'1','2','3'},
- {'4','5','6'},
- {'7','8','9'},
- {'*','0','#'}
- };
- byte pinrows[rows]={6,5,4,3};
- byte pincols[cols]={2,1,0};
- Keypad keypad = Keypad(makeKeymap(keys),pinrows,pincols,rows,cols);
- //Сервомотор
- int servostate;
- Servo myservo;
- //РК екран
- LiquidCrystal lcd(8,9,10,11,12,13);
- void setup()
- {
- lcd.begin(16,2);
- myservo.attach(7);
- myservo.write(Close);
- servostate = 0;
- }
- void loop()
- {
- char key = keypad.getKey();
- if(key)
- {
- lcd.setCursor(6+var,1);
- lcd.print(key);lcd.setCursor(6+var,1);delay(200);lcd.print(f);
- var++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement