Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

Share this Page URL

The Flight > Advanced LCD Control - Pg. 168

168 Chapter 9 A few additional macros will help complete the library: l putLCD() will send ASCII data to the LCD module WriteLCD( LCDDATA, (d)) #define putLCD( d) l CmdLCD() will send generic commands to the LCD module WriteLCD( LCDCMD, (c)) #define CmdLCD( c) l HomeLCD() will reposition the cursor on the first character of the first row WriteLCD( LCDCMD, 2) #define HomeLCD() l ClrLCD() will clear the entire contents of the display WriteLCD( LCDCMD, 1) #define ClrLCD() And finally, for our convenience, we might want to add putsLCD(), a function that will send an entire null-terminated string to the display module. void putsLCD( char *s) { while( *s) putLCD( *s++); } // putsLCD Let's put all of the above to work adding a short main function: