KRITSADA

POP-7 Simple Line Tracking

Jul 11th, 2018
433
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. #include <pop7.h>  // POP-7 Board
  2. word L,R,CL=260,CR=400,j=0;
  3. void setup() {  
  4.   OK();
  5.   setTextSize(3);
  6.   out(13,0);out(14,0);
  7. }
  8. void loop() {
  9.   L=analog(1);R=analog(2);
  10.   if(L>CL&&R>CR){fd(60);}
  11.   else if(L<CL&&R>CR){sl(60);}
  12.   else if(L>CL&&R<CR){sr(60);}
  13. }
Advertisement
Add Comment
Please, Sign In to add comment