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.
Displaying random numbers and scrolling - Arduino Tutorial
From the course: Learning Arduino: Interfacing with Hardware
Displaying random numbers and scrolling
- [Instructor] Alright, so I've covered arrays and I've covered a for loop. So let's try and have some fun in trying to implement a for loop where we generate a random number and try to display that in the lcd. So I want you to go ahead and open the file 0108 lcd starter project. And in the starter project, I've kinda included things that we've covered in the previous example. So in line four, we initialize the pins and line six is the lcd function. So let's start by declaring an array type integer that has 27 values. So int and I'll name it as a random number array and it takes up to 27 values. So I've chose 27 because it's a number of the character that we can see in each line of the lcd type that we're using. Alright so we've initialized the array so let's go and start coding. So the very first thing that I wanna to specify is where I wanna show the numbers. Do I wanna show them in the first line or 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
-
-
-
(Locked)
Introduction to the liquid crystal display (LCD)1m 29s
-
(Locked)
Understanding HD4470 controller1m 58s
-
(Locked)
The LCD interface2m 44s
-
Wire up the LCD5m 6s
-
(Locked)
Coding the LCD interface4m 31s
-
(Locked)
Optional review: Understanding "for" loops3m 36s
-
(Locked)
Optional review: Understanding arrays2m 3s
-
(Locked)
Displaying random numbers and scrolling4m 5s
-
(Locked)
-
-
-
-