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.
Diff: main.cpp
- Revision:
- 0:fc115f874555
- Child:
- 1:b8b505e84b78
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Oct 15 02:28:50 2020 +0000 @@ -0,0 +1,26 @@ +#include "mbed.h" + +Serial pc(USBTX, USBRX) ; +DigitalOut led1(LED1); +DigitalOut led2(LED2); +DigitalOut led3(LED3); +AnalogIn aI(p19); +float T; +int V; +V = (-3.88*10^(-6)*T^2)+(-1.15*10^(-2)*T)+1.8639; + +int main() { +aI.read_u16()="V"; +pc.printf("V=%d\r\n", V ); +while(1) { + if (25>=T>20) { + led1=!led1; + pc.printf("T=%f\r\n", T ); } + else if (30>=T>25) { + led2=!led2; + pc.printf("T=%f\r\n", T ); } + else (T>30) { + led3=!led3; + pc.printf("T=%f\r\n", T ); } +} +} \ No newline at end of file