Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:0a87a16dfdf6
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Dec 05 02:35:28 2018 +0000 @@ -0,0 +1,30 @@ +#include "mbed.h" +Serial xbee1(dp16, dp15); +AnalogIn analog_value(dp13); + +DigitalOut myled(LED1); +DigitalOut led(dp24); +Serial pc(USBTX, USBRX); + +int main() { + int count = 0; + float meas, temp; + printf("\r\nAnalogIn example\r\n"); + + while(1) { + meas= analog_value.read(); + meas=meas*3300; + temp=0.1*meas-50; + printf("%d: ochi,temp = %.1f C\r\n" ,count++ ,temp); + + + if(temp>26.0){ + led.write (1.0); + } + else{ + led.write(0.0); + } + + wait(1.0); + } +}