mbed Application Shield test pg.
Dependencies: C12832 LM75B MMA7660 mbed
main.cpp@0:5d1367a53ae7, 2016-10-21 (annotated)
- Committer:
- txracing
- Date:
- Fri Oct 21 06:32:43 2016 +0000
- Revision:
- 0:5d1367a53ae7
first commit!
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
txracing | 0:5d1367a53ae7 | 1 | #include "mbed.h" |
txracing | 0:5d1367a53ae7 | 2 | #include "LM75B.h" |
txracing | 0:5d1367a53ae7 | 3 | #include "C12832.h" |
txracing | 0:5d1367a53ae7 | 4 | #include "MMA7660.h" |
txracing | 0:5d1367a53ae7 | 5 | |
txracing | 0:5d1367a53ae7 | 6 | // Using Arduino pin notation |
txracing | 0:5d1367a53ae7 | 7 | C12832 lcd(D11, D13, D12, D7, D10); |
txracing | 0:5d1367a53ae7 | 8 | MMA7660 MMA(D14,D15); |
txracing | 0:5d1367a53ae7 | 9 | LM75B sensor(D14,D15); |
txracing | 0:5d1367a53ae7 | 10 | |
txracing | 0:5d1367a53ae7 | 11 | int main() |
txracing | 0:5d1367a53ae7 | 12 | { |
txracing | 0:5d1367a53ae7 | 13 | |
txracing | 0:5d1367a53ae7 | 14 | while(true) { // this is the third thread |
txracing | 0:5d1367a53ae7 | 15 | lcd.cls(); |
txracing | 0:5d1367a53ae7 | 16 | lcd.locate(0,3); |
txracing | 0:5d1367a53ae7 | 17 | lcd.printf("mbed application shield!\n"); |
txracing | 0:5d1367a53ae7 | 18 | lcd.printf("x=%.2f y=%.2f z=%.2f\n",MMA.x(), MMA.y(), MMA.z()); |
txracing | 0:5d1367a53ae7 | 19 | lcd.printf("Temp = %.1f", sensor.temp()); |
txracing | 0:5d1367a53ae7 | 20 | wait(1.0); |
txracing | 0:5d1367a53ae7 | 21 | } |
txracing | 0:5d1367a53ae7 | 22 | } |