From the course: Learning Arduino: Interfacing with Hardware
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Using the keypad with LEDs - Arduino Tutorial
From the course: Learning Arduino: Interfacing with Hardware
Using the keypad with LEDs
- [Instructor] All right, so now, we've got the keypad working the software. Let's continue programming our case where we have three LEDs. So, what we want to do is we want to program the software that when we press one, the red LED turns on, when we press two, the blue LED turns on, and when we press three, the last one, the yellow LED turns on and zero turns off everything. So, in the code I'm going to go scroll up and identify the LEDs first. So, I'm going to write that down. So, if there are constant int, the red LED is connected to pin nine. Then blue LED is connected to 10. And finally, the yellow one is connected to 11. All right, so now the next step is in the void setup. I need to identify the pins as outputs. So, red, and to copy and paste the code and just change the pin. All right. So now, what I want, whenever we press on the keypad is whenever we have a value, and that's already initialized in the line…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Introduction to the keypad interface2m 1s
-
Wiring up the keypad1m 57s
-
(Locked)
Optional review: IF statement1m 28s
-
(Locked)
Optional review: The switch...case statement1m 40s
-
(Locked)
Understanding two-dimensional arrays1m 58s
-
(Locked)
Setup the keypad library2m 10s
-
(Locked)
HelloKeypad4m 41s
-
(Locked)
Using the keypad with LEDs5m 6s
-
(Locked)
Combine the keypad and 7-segment LED5m 47s
-
(Locked)
Combine them all: LCD + keypad + LED4m 44s
-
(Locked)
-