![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
helloサンプル
Fork of SB1602E_Hello by
main.cpp@3:636908e4c711, 2016-09-21 (annotated)
- Committer:
- tek7077
- Date:
- Wed Sep 21 00:25:49 2016 +0000
- Revision:
- 3:636908e4c711
- Parent:
- 2:e0a0d0012d3d
lcd test
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
okano | 0:da994a60a91d | 1 | #include "mbed.h" |
okano | 0:da994a60a91d | 2 | #include "SB1602E.h" |
okano | 0:da994a60a91d | 3 | |
tek7077 | 3:636908e4c711 | 4 | Serial pc(USBTX,USBRX); |
tek7077 | 2:e0a0d0012d3d | 5 | I2C i2c( p22, p20 ); |
tek7077 | 3:636908e4c711 | 6 | SB1602E lcd( p22, p20 ); |
okano | 0:da994a60a91d | 7 | |
tek7077 | 2:e0a0d0012d3d | 8 | int main(){ |
tek7077 | 2:e0a0d0012d3d | 9 | lcd.contrast(0x30); |
okano | 1:23b641db0735 | 10 | // i2c.frequency( 100 * 1000 ); |
okano | 1:23b641db0735 | 11 | while ( 1 ) { |
tek7077 | 2:e0a0d0012d3d | 12 | |
okano | 1:23b641db0735 | 13 | lcd.printf( 0, "Hello world!\r" ); // line# (0 or 1), string |
okano | 1:23b641db0735 | 14 | lcd.printf( 1, "pi = %.6f\r", 3.14159265 ); |
okano | 1:23b641db0735 | 15 | wait( 1 ); |
tek7077 | 3:636908e4c711 | 16 | |
okano | 1:23b641db0735 | 17 | } |
okano | 0:da994a60a91d | 18 | } |