1
Revision 2:a5d1974bd7c9, committed 2016-09-04
- Comitter:
- yu10078999
- Date:
- Sun Sep 04 08:50:23 2016 +0000
- Parent:
- 1:b4da0411aab0
- Commit message:
- 3
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sun Sep 04 08:23:52 2016 +0000
+++ b/main.cpp Sun Sep 04 08:50:23 2016 +0000
@@ -2,17 +2,17 @@
AnalogIn lm35(A0);
Serial esp8266(D6, D7);//tx, rx
-char i;
int main() {
float val,tempC,tempF;
+ int i;
while(1)
{
val=lm35.read();
tempC=(val*2.8f*100);
tempF=(9.0f*tempC)/5.0f + 32.0f;
printf("%.2f\n%.2f\n",tempC,tempF);
- i=tempC;
+ i=(int)tempC;
esp8266.putc(i);
wait(2);
}