![](/media/cache/profiles/3b56beb4fb3143ab7f05335134909435.50x50_q85.jpg)
Variation. Temperature reading moves across x-axis with time, it is positioned in y-axis proportional to temperature as read.
Dependencies: C12832_lcd LM75B mbed
Fork of app-board-LM75B by
Diff: main.cpp
- Revision:
- 4:e7ecb33e5806
- Parent:
- 3:4d612f16ad84
- Child:
- 5:b7c60e64fbf0
diff -r 4d612f16ad84 -r e7ecb33e5806 main.cpp --- a/main.cpp Fri Oct 26 21:42:06 2012 +0000 +++ b/main.cpp Wed Oct 23 04:06:27 2013 +0000 @@ -1,18 +1,30 @@ #include "mbed.h" #include "LM75B.h" #include "C12832_lcd.h" +#include <math.h> C12832_LCD lcd; LM75B tmp(p28,p27); +float temp=0; +int i = 0; +int n = 129; + int main () { - - while (1) { + lcd.cls(); + for (i = 0; i < n; i = i + 1) { + temp = floor(tmp.read()); + lcd.locate(i,(32-(temp))); + lcd.printf("%.0f\n",temp); + wait(.1); + if (i == (n-10)){ + i = 0; lcd.cls(); - lcd.locate(0,3); - lcd.printf("%.2f\n",tmp.read()); - wait(1.0); + } + else + ; } +} -} +