test pour le lycée Blaise PAscal Orsay
Dependencies: C12832 LM75B mbed
Fork of app-board-LM75B by
main.cpp@6:a27a45c31a6d, 2017-11-08 (annotated)
- Committer:
- bouaziz
- Date:
- Wed Nov 08 09:26:29 2017 +0000
- Revision:
- 6:a27a45c31a6d
- Parent:
- 5:608f2bf4d3f7
- Child:
- 7:17934cf0d649
test1 pour lycee Blaise Pascal
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
okano | 0:ce7a8546502b | 1 | #include "mbed.h" |
chris | 2:9e757151de9b | 2 | #include "LM75B.h" |
chris | 5:608f2bf4d3f7 | 3 | #include "C12832.h" |
okano | 0:ce7a8546502b | 4 | |
chris | 5:608f2bf4d3f7 | 5 | C12832 lcd(p5, p7, p6, p8, p11); |
chris | 5:608f2bf4d3f7 | 6 | |
chris | 4:6df97cb10041 | 7 | LM75B sensor(p28,p27); |
chris | 4:6df97cb10041 | 8 | Serial pc(USBTX,USBRX); |
okano | 0:ce7a8546502b | 9 | |
bouaziz | 6:a27a45c31a6d | 10 | |
chris | 2:9e757151de9b | 11 | int main () |
okano | 0:ce7a8546502b | 12 | { |
okano | 0:ce7a8546502b | 13 | |
chris | 4:6df97cb10041 | 14 | //Try to open the LM75B |
chris | 4:6df97cb10041 | 15 | if (sensor.open()) { |
chris | 4:6df97cb10041 | 16 | printf("Device detected!\n"); |
chris | 4:6df97cb10041 | 17 | |
chris | 4:6df97cb10041 | 18 | while (1) { |
chris | 4:6df97cb10041 | 19 | lcd.cls(); |
chris | 4:6df97cb10041 | 20 | lcd.locate(0,3); |
chris | 4:6df97cb10041 | 21 | lcd.printf("Temp = %.3f\n", (float)sensor); |
chris | 4:6df97cb10041 | 22 | wait(1.0); |
chris | 4:6df97cb10041 | 23 | } |
chris | 4:6df97cb10041 | 24 | |
chris | 4:6df97cb10041 | 25 | } else { |
chris | 4:6df97cb10041 | 26 | error("Device not detected!\n"); |
chris | 2:9e757151de9b | 27 | } |
okano | 0:ce7a8546502b | 28 | |
okano | 0:ce7a8546502b | 29 | } |