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.
main.cpp
00001 /** Hello program for the text LCD module "SB1602E" class library 00002 * 00003 * @author Tedd OKANO 00004 * @version 2.01 00005 * @date 05-Jan-2015 00006 * 00007 * SB1602E is an I2C based low voltage text LCD panel (based Sitronix ST7032 chip) 00008 * The module by StrawberryLinux 00009 * http://strawberry-linux.com/catalog/items?code=27002 (Online shop page (Japanese)) 00010 * http://strawberry-linux.com/pub/ST7032i.pdf (datasheet of the chip) 00011 * 00012 * This is a library to operate this module easy. 00013 * 00014 * Released under the Apache 2 license License 00015 */ 00016 00017 #include "mbed.h" 00018 #include "SB1602E.h" 00019 00020 DigitalOut led( LED4 ); 00021 #if 0 00022 I2C i2c( p9, p10 ); 00023 SB1602E lcd( i2c ); // SDA, SCL 00024 #else 00025 SB1602E lcd( p9, p10 ); // SDA, SCL 00026 #endif 00027 //SB1602E lcd( p28, p27 ); // SDA, SCL 00028 00029 int main() 00030 { 00031 // i2c.frequency( 100 * 1000 ); 00032 while ( 1 ) { 00033 lcd.printf( 0, "Hello world!\r" ); // line# (0 or 1), string 00034 lcd.printf( 1, "pi = %.6f\r", 3.14159265 ); 00035 wait( 1 ); 00036 led = !led; 00037 } 00038 }
Generated on Wed Jul 13 2022 18:43:22 by 1.7.2