Uploaded November 2024 | Updated November 2026, 2 days ago
In this second episode, we're diving deeper into the world of sensors by introducing a button and a potentiometer! We'll explore how to read and write both digital and analog signals, expanding on what we learned about controlling an LED in the first episode.
Digital signals are straightforward on/off switches, while analog signals offer a range of values that can be used to create more nuanced interactions. By reading input from the button and potentiometer, we'll control an LED in two exciting ways: toggling it on and off with digitalWrite and adjusting its brightness with analogWrite using PWM pins.
References:
π Arduino: arduino.cc
-
LET'S CONNECT
β¨ Sign up for my newsletter at pattvira.com
β¨ Instagram: instagram.com/pattvira
β¨ Twitter: twitter.com/pattvira
-
Timestamps:
0:00 Intro
0:48 digitalRead() from a button
5:28 Explain serial communication
8:30 Fix switch bouncing issue #1 using delay()
11:35 Fix switch bouncing issue #2 using timing function
17:02 digitalWrite() to turn LED on & off
18:57 analogRead() from a potentiometer
22:27 analogWrite() to control LED's brightness
In this second episode, we're diving deeper into the world of sensors by introducing a button and a potentiometer! We'll explore how to read and write both digital and analog signals, expanding on what we learned about controlling an LED in the first episode.
Digital signals are straightforward on/off switches, while analog signals offer a range of values that can be used to create more nuanced interactions. By reading input from the button and potentiometer, we'll control an LED in two exciting ways: toggling it on and off with digitalWrite and adjusting its brightness with analogWrite using PWM pins.
References:
π Arduino: arduino.cc
-
LET'S CONNECT
β¨ Sign up for my newsletter at pattvira.com
β¨ Instagram: instagram.com/pattvira
β¨ Twitter: twitter.com/pattvira
-
Timestamps:
0:00 Intro
0:48 digitalRead() from a button
5:28 Explain serial communication
8:30 Fix switch bouncing issue #1 using delay()
11:35 Fix switch bouncing issue #2 using timing function
17:02 digitalWrite() to turn LED on & off
18:57 analogRead() from a potentiometer
22:27 analogWrite() to control LED's brightness










