Hack star
Published © MIT

ESP32 Simulator - 2022 - Photosensor-Embedded Systems

ESP32 simulator is free - Works on all browsers - Easy to share ESP32 projects #ArduinoProjects #EmbeddedSystemsSimulator #LearnESP32Faster

BeginnerProtip2 hours1,169

Things used in this project

Story

Read more

Schematics

firefox_nfnrxr7fxi_mRmtcK20eH.png

Code

ESP32 Simulator - Photolight sensor

Arduino
#include <LiquidCrystal_I2C.h>

#define LDR_PIN 2
LiquidCrystal_I2C lcd(0x27, 20, 4);

void setup() {
  pinMode(LDR_PIN, INPUT);
  lcd.init();
  lcd.backlight();
}

void loop() {
  lcd.setCursor(2, 0);
  lcd.print("Question: ");
  if (digitalRead(LDR_PIN) == LOW) {
    lcd.print("FALSE!");
  } else {
    lcd.print("TRUE! ");
  }
  delay(100);
}

Credits

Hack star
75 projects β€’ 146 followers
an Arduino enthusiast and an electronic hobbyist

Comments