Seeedstudio Arch Examples : Grove Serial LCD - Print strings and numbers

Dependencies:   Grove_Serial_LCD mbed

Files at this revision

API Documentation at this revision

Comitter:
viswesr
Date:
Thu Oct 24 05:24:29 2013 +0000
Commit message:
First version

Changed in this revision

Grove_Serial_LCD.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.lib Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Grove_Serial_LCD.lib	Thu Oct 24 05:24:29 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/viswesr/code/Grove_Serial_LCD/#a166e203e4cf
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Oct 24 05:24:29 2013 +0000
@@ -0,0 +1,21 @@
+#include "mbed.h"
+#include "SerialLCD.h"
+ 
+SerialLCD lcd(P1_13, P1_14);  /* Grove Serial LCD is connected to UART Tx and Rx pins*/
+ 
+int main() {
+    int a=0;    
+    char strBuffer[16];
+    
+    lcd.begin();                 /* initialize Serial LCD communication. */ 
+    lcd.print("mbed with Arch"); /* print text */
+    
+    while (1) {
+         
+        lcd.setCursor(0, 1);         /* set cursor at 0th column and 1st row */
+        sprintf(strBuffer, "%d", a); /* prepare a string buffer to print number */   
+        lcd.print(strBuffer);        /* print the string buffer */
+        wait(0.1);                   /* wait 100ms */ 
+        a++;
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.lib	Thu Oct 24 05:24:29 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/#f37f3b9c9f0b