Test LCD

Dependencies:   mbed

Fork of TextLCDTest by Simon Ford

Files at this revision

API Documentation at this revision

Comitter:
Tomoseec
Date:
Tue Dec 25 06:56:22 2012 +0000
Parent:
0:b77078f30b97
Commit message:
test

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Nov 17 10:16:30 2009 +0000
+++ b/main.cpp	Tue Dec 25 06:56:22 2012 +0000
@@ -1,37 +1,24 @@
-// Write to all HD44780 TextLCD RAM locations, sford
-//
-// A quick hack to write to all the display RAM locations
-// in an HD44780 display, to identify which location maps
-// to which character.
-//
-// Instructions:
-//  - Change TextLCD pinout as appropriate so it works
-//  - Run, and it should fill the screen with characters
-//  - Identify what characters are at the start of each row
-//
-// To determine what address each line starts at, you subtract the 
-// ascii code for '0'(48) from the character at the start of each line
-//  - see http://www.asciitable.com/
-// 
-// e.g.
-//   +----------------+
-//   |0123456789:;<=>?| first char = '0' (48)
-//   |XYZ....         | first char = 'X' (88)
-//   +----------------+
-//  
-// So in this case, the RAM offsets are 0 and 40
 
 #include "mbed.h"
 #include "TextLCD.h"
 
-TextLCD lcd(p10, p11, p12, p15, p16, p29, p30);
+TextLCD lcd(p24, p25, p26, p27, p28, p29, p30);//NGX mX-Base-Board Ver1.2 Type
+//(PinName rs, PinName rw, PinName e, PinName d0, PinName d1, PinName d2, PinName d3, int columns, int rows)
+
 DigitalOut led(LED1);
 
 int main() {
+
+    lcd.cls();
     lcd.locate(0,0);
-    for(int i=0; i<80; i++) {
-        lcd._rs = 1; 
-        lcd.writeByte('0' + i);
+    lcd.printf("Hello World!");
+    lcd.locate(0,1);
+    lcd.printf("Tomoseec");
+    while(1) {
+        led = 1;
+        wait(0.2);
+        led = 0;
+        wait(0.2);
     }
 }