bby256
Published © GPL3+

Button Checker

Check the value of a button.

BeginnerFull instructions provided49
Button Checker

Things used in this project

Hardware components

I2C LCD
×1
Push button
×1
Arduino UNO
Arduino UNO
×1
Breadboard (generic)
Breadboard (generic)
×1
Resistor 1k ohm
Resistor 1k ohm
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE
Windows 10
Microsoft Windows 10

Story

Read more

Schematics

Schematics

Code

Codes

C/C++
Arduino IDE code
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);  //sometimes the LCD adress is not 0x27. Change to 0x3f if it doesn't work.

void setup() {
  lcd.init();                 //Init the LCD
  lcd.backlight();            //Activate backlight     

  lcd.print("BUTTON");        //Intro   
  lcd.setCursor(0, 1);
  lcd.print("CHECK");
  delay(3000);    
}

void loop() {
  lcd.clear();
  lcd.print("VALUE:");      
  lcd.print(digitalRead(4));  //The value of the button
  delay(300);  
}

Credits

bby256
0 projects • 0 followers
Contact

Comments

Please log in or sign up to comment.