#include <LiquidCrystal.h>
#include <Servo.h>
#include <Keypad.h>
LiquidCrystal lcd(12,11,4,3,2,1);
int servopin = 5;
Servo servo;
int angle=0;
const uint8_t ROWS = 4;
const uint8_t COLS = 4;
char keys[ROWS][COLS] = {
{ '1', '2', '3', 'A' },
{ '4', '5', '6', 'B' },
{ '7', '8', '9', 'C' },
{ '*', '0', '#', 'D' }
};
uint8_t colPins[COLS] = { 13, 10, 9, 8 }; // Pins connected to C1, C2, C3, C4
uint8_t rowPins[ROWS] = { 7, 6, 0, 0 }; // Pins connected to R1, R2, R3, R4
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);
void setup() {
// put your setup code here, to run once:
servo.attach(servopin);
Serial.begin(9600);
lcd.begin(16,2);
lcd.clear();
}
void loop() {
// put your main code here, to run repeatedly:
lcd.print("good bye!");
lcd.setCursor(0,1);
for(angle=0;angle=90;angle++){
servo.write(angle);
}
}