M0Board_WF
/
WF_lektion9-LM75B_einmal_lesen_LED_schreiben
a
main.cpp
- Committer:
- bulmenwt
- Date:
- 2015-01-28
- Revision:
- 1:b7965a82c352
- Parent:
- 0:1adfdceaa068
File content as of revision 1:b7965a82c352:
/*M0-BOARD LPC11U24 VERSION 1.0 WF 11_2014 BULME Graz / Elektronik 29 Alternativ ohne Library für LM75B UART Raspberry PI lesen */ #include "mbed.h" #include "LM75B.h" DigitalOut Led1(LED1); DigitalOut Led2(LED2); DigitalOut Led3(LED3); DigitalOut Led4(LED4); Serial pc(USBTX, USBRX); // tx, rx char ch; //Create an LM75B object at the default address (ADDRESS_0) LM75B sensor(p28, p27); int main() { while (1) { printf("%.1f\n\r", (float)sensor); Led4=1; wait(0.2); Led4=0; wait(0.2); ch = pc.getc(); if (ch == 'a') { // LED Led1 = 1; } else if (ch == 'b') { Led1 = 0; } } }