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.
lm35.cpp
00001 #include "lm35.h" 00002 Ticker lm35_temp; 00003 AnalogIn LMtemp(A0); 00004 uint16_t cnt=KF; 00005 float sum; 00006 LM35_t LM35_0; 00007 void read() 00008 { 00009 if(cnt--){ 00010 sum+=330*LMtemp.read(); 00011 } 00012 else {//сообщить о готовности результата и записать результат в переменную. 00013 LM35_0.ready=1; 00014 LM35_0.temp=sum/KF; 00015 sum=0; 00016 cnt=KF; 00017 } 00018 } 00019 00020 void LM35_start(float per) 00021 { 00022 lm35_temp.attach(&read,per/KF); 00023 } 00024 00025 void LM35_stop(void) 00026 { 00027 lm35_temp.detach(); 00028 }
Generated on Sun Jul 31 2022 03:25:04 by
1.7.2