Display
We programmed the LCD display (see Figure 8-12) to output the information we found useful debugging and operating the controller.We chose to output the ADC sample values, set point temperature, PWM parameter, and temperature computed from the ADC samples, but it’s relatively simple to change what’s displayed.
The display routine, as written, pads the output strings with extra spaces at the end to ensure all previous characters on the display are overwritten.We originally wrote the code to simply clear the LCD and then write the text, but noticed some objectionable flicker we were able to eliminate with this approach. The text moves left and right a little depending on the number of characters in the first set of digits (the ADC and PWM values); if you found that objectionable, you could use direct cursor addressing and output the display items as four different sequences (two on each line) instead of two (one per line).