From the course: Learning Arduino: Interfacing with Hardware
Unlock the full course today
Join today to access over 24,200 courses taught by industry experts.
Optional review: The switch...case statement - Arduino Tutorial
From the course: Learning Arduino: Interfacing with Hardware
Optional review: The switch...case statement
- [Instructor] All right, so I'm going to go through the switch...case statement. If you are familiar with the concept, you can skip this video, but if you want to refresh your memory about what the concept is, I'm going to go through the concept briefly. So one of the structure commands used within Arduino is a switch...case statement. Oftentimes, we might need to compare a variable against several possible values. For example, the keypad we're using, so we might need to have an assorted output to be associated when we press certain numbers on the keypad. The switch statement uses a standard if...then style condition to evaluate for results. The Arduino jumps to the matching case statement in the code, skipping over the other case statements. You can have a default statement at the end of the switch statement code block. The Arduino software jumps to the default statement when none of the cases matches the results. So…
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)
-