A Hello program for the text LCD module SB1602E class driver. The SB1602E's old class driver (TextLCD_SB1602B) has been rewritten in more common manner of I2C devices.
Hello program for the text LCD module "SB1602E" class library
- SB1602E is an I2C based low voltage text LCD panel (based Sitronix ST7032 chip)
- http://strawberry-linux.com/catalog/items?code=27002 (Online shop page (Japanese))
- http://strawberry-linux.com/pub/ST7032i.pdf (datasheet of the chip)
The "Test" program is available also.
The test program can demonstrate full functionalities of this library.
Import programSB1602E_test
Test program for SB1602E class library
Revision 1:23b641db0735, committed 2015-01-05
- Comitter:
- okano
- Date:
- Mon Jan 05 05:20:14 2015 +0000
- Parent:
- 0:da994a60a91d
- Commit message:
- sample code version to include latest library
Changed in this revision
SB1602E.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 |
diff -r da994a60a91d -r 23b641db0735 SB1602E.lib --- a/SB1602E.lib Mon Oct 20 12:59:46 2014 +0000 +++ b/SB1602E.lib Mon Jan 05 05:20:14 2015 +0000 @@ -1,1 +1,1 @@ -http://developer.mbed.org/users/okano/code/SB1602E/#995f80348e02 +http://developer.mbed.org/users/okano/code/SB1602E/#fce3e353410c
diff -r da994a60a91d -r 23b641db0735 main.cpp --- a/main.cpp Mon Oct 20 12:59:46 2014 +0000 +++ b/main.cpp Mon Jan 05 05:20:14 2015 +0000 @@ -1,8 +1,8 @@ /** Hello program for the text LCD module "SB1602E" class library * * @author Tedd OKANO - * @version 2.0 - * @date 20-Oct-2014 + * @version 2.01 + * @date 05-Jan-2015 * * SB1602E is an I2C based low voltage text LCD panel (based Sitronix ST7032 chip) * The module by StrawberryLinux @@ -17,10 +17,22 @@ #include "mbed.h" #include "SB1602E.h" +DigitalOut led( LED4 ); +#if 0 +I2C i2c( p9, p10 ); +SB1602E lcd( i2c ); // SDA, SCL +#else SB1602E lcd( p9, p10 ); // SDA, SCL +#endif //SB1602E lcd( p28, p27 ); // SDA, SCL -int main() { - lcd.printf( 0, "Hello world!" ); // line# (0 or 1), string - lcd.printf( 1, "pi = %.6f", 3.14159265 ); +int main() +{ +// i2c.frequency( 100 * 1000 ); + while ( 1 ) { + lcd.printf( 0, "Hello world!\r" ); // line# (0 or 1), string + lcd.printf( 1, "pi = %.6f\r", 3.14159265 ); + wait( 1 ); + led = !led; + } }