M0Board_WF
/
WF_mbed_UART_temp
a
Diff: main.cpp
- Revision:
- 0:d3c7895406b6
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Jan 28 07:51:55 2015 +0000 @@ -0,0 +1,44 @@ +#include "mbed.h" +#include "LM75B.h" + + + +DigitalOut Led1(LED1); +DigitalOut Led2(LED2); +DigitalOut Led3(LED3); +DigitalOut Led4(LED4); + + +Serial fs(USBTX, USBRX); +char ch; + + +LM75B sensor(p28, p27) ; /// SCL, SCD + + + +int main() { + + if (sensor.open()) { + fs.printf("Device detectedd!\r\n"); + + while(1) { + + Led4=1; + wait(0.5); + Led4=0; + wait(0.5); + + + fs.printf("Temperatur =%.3f\n\r",(float)sensor); + + wait(0.5); + } + + } else { + + fs.printf("Device not found!\r\n"); + + } + } +