Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ipst.h>
- int val,i;
- float Temp;
- void setup(){ glcdClear(); setTextSize(2); }
- void loop(){
- glcd(1,2,"Digital");
- glcd(2,2,"THERMO");
- glcd(3,3,"METER");
- val=0;
- for (i=0;i<20;i++) {val = val+analog(1); }
- val = val/20;
- Temp = (float(val)*0.25) - 20.51 ;
- setTextSize(3);
- setTextColor(GLCD_YELLOW);
- glcd(3,1,"%f",Temp);
- setTextColor(GLCD_WHITE);
- setTextSize(2);
- glcd(6,2,"Celsius");
- delay(500);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement