KRITSADA

08 POP-X2 Toggle Switch Control LED

Feb 20th, 2018
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. // กดสวิตช์แล้ว LED ติด กดอีกครั้ง LED ดับ
  2.  
  3. #include <popx2.h>
  4. int i=0;
  5. void setup() {setTextSize(3);}
  6. void loop() {
  7.     if(!in(30)){
  8.         while(!in(30));
  9.         if(i==0){
  10.             out(24,1); i=1;
  11.         }
  12.         else{
  13.             out(24,0); i=0;
  14.         }
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment