Test program for driving the GHI Character Display module from the Outrageous Circuits mBuino platform
Dependencies: TextLCD USBDevice mbed
main.cpp
- Committer:
- devhammer
- Date:
- 2014-11-25
- Revision:
- 0:271f8cc9758c
- Child:
- 1:c126b5e56bd0
File content as of revision 0:271f8cc9758c:
#include "mbed.h" #include "TextLCD.h" //#include "USBSerial.h" //USBSerial pc; // These pin assignments work for the Outrageous Circuits' mBuino platform // http://developer.mbed.org/platforms/Outrageous-Circuits-mBuino/ // // This code example uses the GHI Character Display module for .NET Gadgeteer: // https://www.ghielectronics.com/catalog/product/395 // and breaks out the pins via a GHI Extender module, but the code should // work with any HD44780-based LCD (socket/pin map at above URL) // // Code example leverages the TextLCD library for communicating with the // Display Module, and is a modified version of the example code from // that library. // http://developer.mbed.org/users/simon/code/TextLCD/ // // Note that the 5V supply for the display must be provided externally, as // well as power for the backlight pin. // Uncomment the include for USBSerial.h, the USBSerial declaration, and the // pc.printf statements to enable serial debugging over USB. TextLCD lcd(P0_10, P0_9, P0_15, P0_11, P0_13, P0_18); // rs, e, d4-d7 int main() { //pc.getc(); // wait(5); // pc.printf("Initializing...\r\n"); wait(2); // pc.printf("Writing Hello, World! to char display...\r\n"); lcd.printf("Hello World!\n"); // wait(2); // pc.printf("Text written to char display...\r\n"); // pc.printf("Writing mBuino rocks! to char display...\r\n"); lcd.printf("mBuino rocks!"); // wait(2); // pc.printf("Text written to char display...\r\n"); }