ESP32 LED Dimming Tutorial with Potentiometer | Control Brightness in Real Time | English Subtitle

  Рет қаралды 110

DoIt.20

DoIt.20

Күн бұрын

Пікірлер: 1
@doit.20
@doit.20 5 ай бұрын
const int potPin = 34; // Analog input pin for potentiometer on ESP32 const int ledPin = 5; // PWM enabled pin for LED on ESP32 void configurePWM() { const int freq = 5000; // PWM frequency const int ledChannel = 0; // PWM channel const int resolution = 8; // PWM resolution (8 bits) // Configure LED PWM functionalities ledcSetup(ledChannel, freq, resolution); // Attach the channel to the GPIO to be controlled ledcAttachPin(ledPin, ledChannel); } void setup() { pinMode(potPin, INPUT); // Set the potentiometer pin as input configurePWM(); // Configure PWM for the LED } void loop() { int sensorValue = analogRead(potPin); // Read potentiometer value (0-4095 on ESP32) int brightness = map(sensorValue, 0, 4095, 0, 255); // Map potentiometer value to LED brightness (0-255) ledcWrite(0, brightness); // Set LED brightness using PWM on channel 0 }
Creating PWM Signal on ESP32 - Step by Step Guide for Beginners
12:25
Upload Ideas With Itamar
Рет қаралды 1 М.
Have you ever seen soldering THIS close?
9:53
Robert Feranec
Рет қаралды 651 М.
風船をキャッチしろ!🎈 Balloon catch Challenges
00:57
はじめしゃちょー(hajime)
Рет қаралды 75 МЛН
Human vs Jet Engine
00:19
MrBeast
Рет қаралды 206 МЛН
Ice Cream or Surprise Trip Around the World?
00:31
Hungry FAM
Рет қаралды 14 МЛН
ESP32 Breadboard with Onboard Power Supply
6:06
Kredence
Рет қаралды 2,4 М.
Unique Projects with Digital Potentiometers
53:23
DroneBot Workshop
Рет қаралды 40 М.
BC547, BC557 TRANSISTOR 14 LED CHASER CIRCUIT | WITH CIRCUIT DIAGRAM
6:31
I tried the Cheapest Arduino Alternative (that Nobody heard of)
13:31
風船をキャッチしろ!🎈 Balloon catch Challenges
00:57
はじめしゃちょー(hajime)
Рет қаралды 75 МЛН