Advertisement
Jaturapad

IPST checkTherMometer Example

Jun 25th, 2016
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include <ipst.h>
  2. int val,i;
  3. float Temp;
  4. void setup(){  glcdClear();  setTextSize(2); }
  5. void loop(){
  6.   glcd(1,2,"Digital");
  7.   glcd(2,2,"THERMO");
  8.   glcd(3,3,"METER");
  9.   val=0;
  10.   for (i=0;i<20;i++)   {val = val+analog(1);  }
  11.   val = val/20;
  12.   Temp = (float(val)*0.25) - 20.51 ;
  13.   setTextSize(3);
  14.   setTextColor(GLCD_YELLOW);
  15.   glcd(3,1,"%f",Temp);
  16.   setTextColor(GLCD_WHITE);
  17.   setTextSize(2);
  18.   glcd(6,2,"Celsius");
  19.   delay(500);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement