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-26
Revision:
1:c126b5e56bd0
Parent:
0:271f8cc9758c

File content as of revision 1:c126b5e56bd0:

#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_5); // rs, e, d4-d7

int main() {
    //pc.getc();
    wait(2);
    lcd.cls();
//    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");
}