Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Wire.h>
- #include <LiquidCrystal_I2C.h>
- const int PinButton = 6;
- boolean on = false;
- int buttonState = 0;
- int position1;
- LiquidCrystal_I2C lcd(0x3F, 16, 2);
- void setup() {
- pinMode(PinButton, INPUT);
- lcd.begin();
- lcd.noBacklight();
- Serial.begin(9600);
- }
- void loop() {
- buttonState = digitalRead(PinButton);
- if (buttonState == HIGH) {
- if (on==true) {
- on=false;
- } else{
- on=true;
- }
- }
- if (on == true) {
- lcd.setBacklight((uint8_t)1);
- lcd.setCursor(0,0);
- lcd.print("Greenhill School");
- // for (position1 = 0; position1 < 16; position1++)
- // {
- // lcd.scrollDisplayLeft();
- // delay(250);
- // }
- }
- else {
- lcd.noBacklight();
- }
- // lcd.clear();
- delay(500);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement