Fikret Eren
/
M0BOARD_FSST03
x
Fork of M0BOARD_FSST03 by
main.cpp
- Committer:
- FlorianStark
- Date:
- 2016-09-28
- Revision:
- 1:60247c53e9f8
- Parent:
- 0:f61110000c3b
- Child:
- 2:e73e456e0542
File content as of revision 1:60247c53e9f8:
#include "mbed.h" #include "LM75B.h" DigitalOut Led1(LED1); DigitalOut Led2(LED2); DigitalOut Led3(LED3); DigitalOut Led4(LED4); Serial fs(USBTX, USBRX); LM75B sensor(p28, p27) ; char ch; int main() { if (sensor.open()) { fs.printf("Device detected!\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"); } /*fs.printf("LED schalten mittels UART\r\n"); fs.printf("FSST 3BHEL\n"); fs.printf("Druecken Sie eine Taste 1, 2, 3 oder 4 (LED)\r\n"); while(1) { ch=fs.getc(); switch (ch) { case '1': Led1=!Led1; break; case '2': Led2=!Led2; break; case '3': Led3=!Led3; break; case '4': Led4=!Led4; break; default: fs.printf("Druecken Sie eine Taste 1, 2, 3 oder 4 (LED)\r\n"); break; } }*/ }