KRITSADA

pop-7 bargraph from analog 1

Feb 28th, 2018
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. #include <pop7.h>
  2. int x;
  3. void setup(){
  4.   glcdMode(1);
  5.   setTextSize(3);
  6. }
  7. void loop(){
  8.    x = map(analog(1),0,1023,0,160);
  9.    glcd(1,0,"%d  ",x);
  10.    glcdFillRect(0,80,x,10,GLCD_RED);
  11.    glcdFillRect(x,80,160-x,10,GLCD_BLACK);
  12. }
Advertisement
Add Comment
Please, Sign In to add comment