Simple LED Control with Button Press | ESP32 | Example Code | English Subtitle | Arduino IDE

  Рет қаралды 88

DoIt.20

DoIt.20

Күн бұрын

Пікірлер: 1
@doit.20
@doit.20 6 ай бұрын
const int ledPin = 14; // Pin to which LED is connected (you can change this pin) const int buttonPin = 15; // Pin to which button is connected (you can change this pin) bool ledOn = false; // Flag to indicate LED status unsigned long lastDebounceTime = 0; // Last time the button pin was toggled unsigned long debounceDelay = 50; // Debounce time in milliseconds void setup() { pinMode(ledPin, OUTPUT); // Set LED pin as output pinMode(buttonPin, INPUT_PULLUP); // Set button pin as input with pull-up resistor } void loop() { int buttonState = digitalRead(buttonPin); // Check if the button is pressed and debounce the input if (buttonState == LOW && (millis() - lastDebounceTime) > debounceDelay) { lastDebounceTime = millis(); // Button is pressed ledOn = !ledOn; // Toggle LED status // Update LED state digitalWrite(ledPin, ledOn ? HIGH : LOW); } }
Amazing remote control#devil  #lilith #funny #shorts
00:30
Devil Lilith
Рет қаралды 15 МЛН
They Chose Kindness Over Abuse in Their Team #shorts
00:20
I migliori trucchetti di Fabiosa
Рет қаралды 12 МЛН
Hoodie gets wicked makeover! 😲
00:47
Justin Flom
Рет қаралды 123 МЛН
The Ultimate Sausage Prank! Watch Their Reactions 😂🌭 #Unexpected
00:17
La La Life Shorts
Рет қаралды 6 МЛН
M5Stack Cardputer: ESP32-S3 Pocket Computer
17:06
ExplainingComputers
Рет қаралды 100 М.
DIY “PN532 BLE” that works with the “MTools BLE” App
1:15
Sabekin Muhammad
Рет қаралды 68
[ESP32] How to display image with TFT LCD
2:22
Pang
Рет қаралды 73
How to Control a 12V Motor with Arduino: Easy Wiring & Code Examples
44:13
Arduino Tutorial 5: Understanding and Working With Binary Numbers
24:49
Amazing remote control#devil  #lilith #funny #shorts
00:30
Devil Lilith
Рет қаралды 15 МЛН