![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
MATSU-bed + I2CLCD sample (e.g. AQM0802A)
Dependencies: mbed I2cLCD MATSUbed USBDevice
Fork of MASTU-bed_I2CLCD by
AQM0802A: http://akizukidenshi.com/catalog/g/gP-06669/
main.cpp@1:ac8ac251e0c3, 2018-12-02 (annotated)
- Committer:
- Tiryoh
- Date:
- Sun Dec 02 13:50:54 2018 +0000
- Revision:
- 1:ac8ac251e0c3
- Parent:
- 0:430362be0583
Add MATSU-bed.h
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Tiryoh | 0:430362be0583 | 1 | #include "mbed.h" |
Tiryoh | 0:430362be0583 | 2 | #include "USBSerial.h" |
Tiryoh | 0:430362be0583 | 3 | #include "I2cLCD.h" |
Tiryoh | 1:ac8ac251e0c3 | 4 | #include "MATSU-bed.h" |
Tiryoh | 0:430362be0583 | 5 | |
Tiryoh | 0:430362be0583 | 6 | USBSerial pc; |
Tiryoh | 0:430362be0583 | 7 | BusOut myled(LED1, LED2, LED3, LED4); |
Tiryoh | 0:430362be0583 | 8 | |
Tiryoh | 0:430362be0583 | 9 | I2cLCD lcd(P0_23, P0_22, P0_20); //sda, scl, reset |
Tiryoh | 0:430362be0583 | 10 | |
Tiryoh | 0:430362be0583 | 11 | int main() { |
Tiryoh | 0:430362be0583 | 12 | int timei = 0; |
Tiryoh | 0:430362be0583 | 13 | myled = 0b0000; |
Tiryoh | 0:430362be0583 | 14 | //while(pc.readable() == 0); |
Tiryoh | 0:430362be0583 | 15 | //pc.printf("KEY DETECTED!!\r\nPROGRAM START\r\n"); |
Tiryoh | 0:430362be0583 | 16 | while(1){ |
Tiryoh | 0:430362be0583 | 17 | pc.printf("program running...\r\n"); |
Tiryoh | 0:430362be0583 | 18 | myled = 0b0001; |
Tiryoh | 0:430362be0583 | 19 | wait(0.1); |
Tiryoh | 0:430362be0583 | 20 | |
Tiryoh | 0:430362be0583 | 21 | lcd.cls(); |
Tiryoh | 0:430362be0583 | 22 | lcd.printf(" %d",timei); |
Tiryoh | 0:430362be0583 | 23 | timei++; |
Tiryoh | 0:430362be0583 | 24 | if(timei>500)timei = 0; |
Tiryoh | 0:430362be0583 | 25 | |
Tiryoh | 0:430362be0583 | 26 | |
Tiryoh | 0:430362be0583 | 27 | myled = 0b0000; |
Tiryoh | 0:430362be0583 | 28 | wait(0.1); |
Tiryoh | 0:430362be0583 | 29 | } |
Tiryoh | 0:430362be0583 | 30 | } |