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.
main.cpp
00001 #include "mbed.h" 00002 00003 AnalogIn analog_value(dp13); 00004 PwmOut led(dp24); 00005 00006 int main(void) { 00007 float meas, temp; 00008 printf("\r\nAnalogIn example\r\n"); 00009 00010 led.period(1.0); 00011 00012 while(1) { 00013 meas= analog_value.read(); 00014 meas=meas*3300; 00015 temp=0.1*meas-50; 00016 printf("measure = %.0f mV, temp = %.1f C\r\n",meas,temp); 00017 00018 if(temp>25.0){ 00019 led.write(0.3); 00020 } 00021 else{ 00022 led.write(0.0); 00023 } 00024 00025 wait(1.0); 00026 } 00027 } 00028 00029
Generated on Sun Jul 24 2022 19:44:33 by
1.7.2