![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
helloサンプル
Fork of SB1602E_Hello by
main.cpp@0:da994a60a91d, 2014-10-20 (annotated)
- Committer:
- okano
- Date:
- Mon Oct 20 12:59:46 2014 +0000
- Revision:
- 0:da994a60a91d
- Child:
- 1:23b641db0735
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.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
okano | 0:da994a60a91d | 1 | /** Hello program for the text LCD module "SB1602E" class library |
okano | 0:da994a60a91d | 2 | * |
okano | 0:da994a60a91d | 3 | * @author Tedd OKANO |
okano | 0:da994a60a91d | 4 | * @version 2.0 |
okano | 0:da994a60a91d | 5 | * @date 20-Oct-2014 |
okano | 0:da994a60a91d | 6 | * |
okano | 0:da994a60a91d | 7 | * SB1602E is an I2C based low voltage text LCD panel (based Sitronix ST7032 chip) |
okano | 0:da994a60a91d | 8 | * The module by StrawberryLinux |
okano | 0:da994a60a91d | 9 | * http://strawberry-linux.com/catalog/items?code=27002 (Online shop page (Japanese)) |
okano | 0:da994a60a91d | 10 | * http://strawberry-linux.com/pub/ST7032i.pdf (datasheet of the chip) |
okano | 0:da994a60a91d | 11 | * |
okano | 0:da994a60a91d | 12 | * This is a library to operate this module easy. |
okano | 0:da994a60a91d | 13 | * |
okano | 0:da994a60a91d | 14 | * Released under the Apache 2 license License |
okano | 0:da994a60a91d | 15 | */ |
okano | 0:da994a60a91d | 16 | |
okano | 0:da994a60a91d | 17 | #include "mbed.h" |
okano | 0:da994a60a91d | 18 | #include "SB1602E.h" |
okano | 0:da994a60a91d | 19 | |
okano | 0:da994a60a91d | 20 | SB1602E lcd( p9, p10 ); // SDA, SCL |
okano | 0:da994a60a91d | 21 | //SB1602E lcd( p28, p27 ); // SDA, SCL |
okano | 0:da994a60a91d | 22 | |
okano | 0:da994a60a91d | 23 | int main() { |
okano | 0:da994a60a91d | 24 | lcd.printf( 0, "Hello world!" ); // line# (0 or 1), string |
okano | 0:da994a60a91d | 25 | lcd.printf( 1, "pi = %.6f", 3.14159265 ); |
okano | 0:da994a60a91d | 26 | } |