Advertisement
waravutbutrat

IPST ไฟเปิดปิดกลางคืน

Jun 25th, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <ipst.h>
  2. int x;
  3. void setup(){}
  4. void loop(){
  5.  x=analog(1);
  6.  glcd(0,0,"%d  ",x);
  7.  if(x<100){
  8.     out(16,1);out(17,1);out(18,1);
  9.    }
  10.    else if(x>=100 && x<200){
  11.     out(16,0);out(17,1);out(18,1);
  12.    }
  13.    else if(x>=200 && x<300){
  14.     out(16,0);out(17,0);out(18,1);
  15.    }
  16.    else {
  17.      out(16,0);out(17,0);out(18,0);
  18.    }
  19.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement