Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Arduino LCD Using Buttons-Right, Left, Up, Down, & Reset
- #include <LiquidCrystal.h>
- LiquidCrystal lcd(8, 13, 9, 4, 5, 6, 7);
- int readkey;
- void setup() {
- lcd.begin(16, 2);
- lcd.print("CLUB JAMECO");
- }
- void loop() {
- lcd.setCursor(0, 1);
- lcd.print("ARDUINO LCD");
- readkey=analogRead(0);
- if (readkey<50) {
- lcd.clear();
- lcd.print("Button Right");
- }
- else if(readkey<195) {
- lcd.clear();
- lcd.print("Button Up");
- }
- else if(readkey<380) {
- lcd.clear();
- lcd.print("Button Down");
- }
- else if(readkey<790) {
- lcd.clear();
- lcd.print("Button Left");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement