Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ATX2.h>
- int y,i;
- long x;
- void setup(){
- glcdMode(1);
- setTextSize(3);
- }
- void loop(){
- x=0;
- // for (i=0;i<100;i++){x=analog(0)+x;}
- // x=x/100;
- // use Maximum Value show on Bargraph
- for (i=0;i<100;i++){x=max(analog(0),x);delay(1);}
- y = map(x,0,1023,0,160);
- glcd(1,0,"%d ",y);
- glcdFillRect(0,80,y,10,GLCD_RED);
- glcdFillRect(y,80,160-y,10,GLCD_BLACK);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement