Page 92 - Making PIC Microcontroller Instruments and Controllers
P. 92
THE I{PUI-
A2 COI{TROLI.II{G THE OUTPUT AND READING
I . Editor: Write a program thal dispiays a random 12 numbers on line I of &e LCD and
displays a cursor that can be moved back and fo h across the 20 spaces with poten-
tiometer 0. The entire range of thc potentiometer must be used to move across the
20 spaces. Allow the keypad to insert numbers 0 to 9 into the posilion the cursor is
on. Assign a delele switch and an insert space switch on the keyboard. A compre-
hensive number (plus decimal and space) editor is required
2. Mirror Write a program that puts a random set of letters and numbers on line 1 and
iheo puts their mirror images on line 2. The mirror is betweer linc I and lirc 2. You
have to learn how to create the upside-down rumbers from the Hitachi datasheet ior
the display, and also learn how lo read whal is in the display from the display ROM.
The display ROM is capable of stodng 40 characlers on each line.
3. Forty Characters:
Design a program to allow you to scroll back and forlh to see all 40 characters on
both lines one line at a time. Use two poientiometers for scrolling, one fol each line
4. Four lines: Wnte a program to display four lines of random data on the LCD and to
scroll up and down and side to side 1o see all fourlines in their entirety You have Io
store what is lost from the screen before it is lost so you can re_create lt when you
5. Bargraphs: Crcate a three-bdrgraph display, with each bar 3 pixels high' that extends
across both lines of the LCD. The lengths of the bargraphs are detemined by the se!
tings of the three potentiometers, which change as the potentiomete$ are manipulated.
By no\ you should be getting pretty good at using lhe 16F877A and are nearly
irady to finish the introduction. Only a little more and we will be ready forjust that!