KRITSADA

07 POP-X2 Switch OK and SW1 Counter

Feb 19th, 2018
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. #include <popx2.h>
  2. int i=0;
  3. void setup() {setTextSize(3);}
  4. void loop() {
  5.     if (sw1()&&sw_OK()){
  6.         i=0;
  7.     }
  8.     else if (sw1()){
  9.         i++;
  10.         while(sw1());
  11.     }
  12.     else if (sw_OK()){
  13.         i--;
  14.         while(sw_OK());
  15.     }
  16.     glcd(1,0,"I=%d ",i);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment