From the course: Learning Arduino: Interfacing with Hardware
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Optional review: Understanding "for" loops - Arduino Tutorial
From the course: Learning Arduino: Interfacing with Hardware
Optional review: Understanding "for" loops
- [Instructor] In our LCD example we are going to use a for loop. So, in case it has been a while since you used a for loop, I'm going to go through that format in order to refresh your memory about it. So for loop starts with for and we have initialization. And the initialization is basically, where do we start the for loop and then, we have the condition, and in the condition we specify how many times we want the for loop to get executed. And then finally, the way we do the increments. And then we add whatever the code we want inside the two brackets. So lets take an example where we use a simple for loop, so initialization, I'm going to use integer value of counter, and remember in initialization I need to specify where I'm starting so in our example I'm going to start from zero. So the initial value is zero. So now according to how many times you want the loop to execute, you change the condition accordingly. So for example, if I want the counter to execute 10 times and in the…
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
-
-
-
Introduction to the liquid crystal display (LCD)1m 29s
-
Understanding HD4470 controller1m 58s
-
The LCD interface2m 44s
-
Wire up the LCD5m 6s
-
Coding the LCD interface4m 31s
-
Optional review: Understanding "for" loops3m 36s
-
Optional review: Understanding arrays2m 3s
-
Displaying random numbers and scrolling4m 5s
-
-
-
-
-