test pour le lycée Blaise PAscal Orsay

Dependencies:   C12832 LM75B mbed

Fork of app-board-LM75B by Chris Styles

Committer:
bouaziz
Date:
Mon Nov 13 18:35:32 2017 +0000
Revision:
7:17934cf0d649
Parent:
6:a27a45c31a6d
test capteur simple temp?rature

Who changed what in which revision?

UserRevisionLine numberNew 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
chris 2:9e757151de9b 10 int main ()
okano 0:ce7a8546502b 11 {
okano 0:ce7a8546502b 12
chris 4:6df97cb10041 13 //Try to open the LM75B
chris 4:6df97cb10041 14 if (sensor.open()) {
chris 4:6df97cb10041 15 printf("Device detected!\n");
chris 4:6df97cb10041 16
chris 4:6df97cb10041 17 while (1) {
chris 4:6df97cb10041 18 lcd.cls();
chris 4:6df97cb10041 19 lcd.locate(0,3);
chris 4:6df97cb10041 20 lcd.printf("Temp = %.3f\n", (float)sensor);
chris 4:6df97cb10041 21 wait(1.0);
chris 4:6df97cb10041 22 }
chris 4:6df97cb10041 23
chris 4:6df97cb10041 24 } else {
chris 4:6df97cb10041 25 error("Device not detected!\n");
chris 2:9e757151de9b 26 }
okano 0:ce7a8546502b 27
okano 0:ce7a8546502b 28 }