Introduction to Microcontroller Programming
About PICmicro Chips
Clocking Your PICmicro Devices E-Blocks Flowcode Step By Step
PICmicro Projects
Labs |
Setting up the LCDThe Hi-Fi system will make use of the LCD display. We want to make the display show the volume and also the radio channel. Later on we can make it display data on the CD player etc. To do this we will use the first line of the display to show the volume and the second line to show the radio channel. In this program we will separate all of the main routines into separate macros to make the structure of the main program easier to read. The two macros we will set up here will initialise the display, and then refresh the display as the program runs.
You should by now have a good grasp of what is happening here. The first icon starts the display, then the cursor is set to 0,0 or the top left. The third icon prints "Volume:" on the top line, and the next icon moves the cursor to the second line. The last icon prints "Channel:" on the bottom line.
Here the first icon moves the cursor to a point after "Volume:". It prints three blank spaces to delete the old volume setting. The next two icons move the cursor back to the previous position and print the value of the 'volume' variable. The next cursor moves to the bottom line of the display after "Channel:", and the last icon prints the actual volume.
|