![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Publish_MAPLEminiA
Dependencies: LSM303DLHC RX8025 SDFileSystem TextLCD TouchSense mbed
Fork of MAPLEminiA by
Diff: main.cpp
- Revision:
- 3:aae83c4bd9a0
- Parent:
- 1:707a0a314781
- Child:
- 4:faf01cf17d60
--- a/main.cpp Sun Jun 05 11:27:26 2016 +0000 +++ b/main.cpp Sat Jun 11 00:41:33 2016 +0000 @@ -1,5 +1,6 @@ /* Sample for MAPLE-mini TypeA board(marutsu-elec MARM02-BASE) * マルツの MAPLE-mini TypeA基板(型番MARM02-BASE)用の動作確認用のプログラムです。 + * mbed1768での動作を確認しています。 */ #include "mbed.h" @@ -20,6 +21,15 @@ I2C i2c(p28,p27); // SDA, SCL TextLCD_I2C_N lcd(&i2c, ST7032_SA, TextLCD::LCD16x2, NC, TextLCD::ST7032_3V3); +// LCD icon test patterns +const int MAXICONS=13; +struct { + int8_t address; + int8_t data; +} const icons[MAXICONS] = { {0x00,0x10},{0x02,0x10},{0x04,0x10},{0x06, 0x10}, + {0x07,0x10},{0x07,0x08},{0x09,0x10},{0x0b,0x10}, + {0x0d,0x1e},{0x0d,0x1a},{0x0d,0x12},{0x0d,0x02}, + {0x0f,0x10} }; RX8025 rtc(i2c); LSM303DLH compass(p28, p27); SDFileSystem sd(p5, p6, p7, p22, "sd"); @@ -67,6 +77,7 @@ sw4.calibration(); speaker.beep(); + int iconcounter=0; while(1) { Times t=rtc.getTIME(); float hdg = compass.heading(); @@ -80,10 +91,13 @@ lcd.locate(0,0); lcd.printf("%d %d %d %d ",s1,s2,s3,s4); lcd.locate(0,1); - lcd.printf("%02X:%02X:%02X %.2f", t.hours, t.minutes, t.seconds, hdg); + lcd.printf("%02X:%02X:%02X %.2f", t.hours, t.minutes, t.seconds, hdg); + lcd.setIcon(icons[iconcounter].address,icons[iconcounter].data); myled = 1; wait(0.2); myled = 0; wait(0.2); + lcd.setIcon(icons[iconcounter].address,0); + if(++iconcounter >= MAXICONS) iconcounter=0; } }