Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const int buttonPin = 6;
- const int buttonPin2 = 7;
- int buttonState = 0;
- int buttonState2 = 0;
- #include <LiquidCrystal.h>
- LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
- void setup() {
- pinMode(buttonPin, INPUT);
- lcd.begin(16, 2);
- lcd.print("test1");
- lcd.setCursor(0, 1);
- lcd.print("test2");
- pinMode(buttonPin, INPUT_PULLUP);
- pinMode(buttonPin2, INPUT_PULLUP);
- }
- void loop() {
- buttonState = digitalRead(buttonPin);
- buttonState2 = digitalRead(buttonPin2);
- if (buttonState == HIGH) {
- lcd.begin(16, 2);
- lcd.print(">test1");
- lcd.setCursor(0, 1);
- lcd.print("test2");
- }
- else {
- }
- if (buttonState2 == HIGH) {
- lcd.begin(16, 2);
- lcd.print("test1");
- lcd.setCursor(0, 1);
- lcd.print(">test2");
- }
- else {
- }
- delay(3);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement