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

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…

Contents