PUSH LIQUID LED — ESP32 simulation

An interactive ESP32 circuit simulation you can run free in your browser on Velxio, by josephkinuthia541.

Components

Sketch code

int LED = 32;
int BUTTON = 33;
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup()
{
  pinMode(LED,OUTPUT);
  pinMode(BUTTON,INPUT_PULLUP);
Wire.begin(23,22);
lcd.init();
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print("Press Button");

}
void loop()
{
  if (digitalRead(BUTTON) == LOW) 
  {
    digitalWrite(LED, HIGH);
lcd.setCursor(0, 0);
lcd.print("Press Button");
lcd.setCursor(0, 1);
lcd.print("LED ONN");
    }
  else
  {
digitalWrite(LED, LOW);
lcd.setCursor(0, 0);
lcd.print("Press Button");
lcd.setCursor(0, 1);
lcd.print("LED OFF");
  }
  
}

More projects by josephkinuthia541