Seeedstudio Arch Examples : Grove Serial LCD - Print strings and numbers
Dependencies: Grove_Serial_LCD mbed
Diff: main.cpp
- Revision:
- 0:a4da5990eeb8
--- /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