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 //#include "DebounceIn.h" 00003 00004 00005 AnalogIn sensor1(p20); // define the hall and temprature sensors 00006 AnalogIn sensor2(p17); 00007 Serial pc(USBTX, USBRX); 00008 00009 Timer timer; 00010 00011 DigitalOut led1(LED1); 00012 DigitalOut led2(LED2); 00013 DigitalOut led3(LED3); 00014 DigitalOut led4(LED4); 00015 00016 00017 00018 int main() { 00019 float time; 00020 float volt1; 00021 float volt2; 00022 float temp; 00023 timer.start(); 00024 while(1) { 00025 time=timer.read(); 00026 volt1=sensor1.read()*3.3; 00027 temp=-1481 + sqrt( 2.1962*pow(10.0,6.0) + (1.8639-volt1)/(3.88*pow(10.0,-6.0)) ); 00028 volt2=sensor2.read()*3.3; 00029 pc.printf("$TTMPL=%f,%f,%f,%f\r\n",time,volt1,temp,volt2); 00030 00031 wait(5); 00032 } 00033 }
Generated on Mon Aug 15 2022 15:01:04 by
1.7.2