Advertisement
KRITSADA

IPST-SE Simple Line Tracking Demo

Jun 23rd, 2016
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. #include <ipst.h>
  2. word L,R,speed;
  3. void setup(){
  4.   OK();
  5.   glcdFillScreen(GLCD_SKY);
  6.   setTextSize(3);
  7.   setTextBackgroundColor(GLCD_SKY);
  8.   setTextColor(GLCD_WHITE);
  9.   glcd(0,0,"IPST-SE");
  10.   setTextColor(GLCD_YELLOW);
  11.   glcd(1,0,"MicroBOX");
  12.   setTextSize(2);
  13.   setTextBackgroundColor(GLCD_YELLOW);
  14.   setTextColor(GLCD_BLACK);
  15.   glcd(4,0,"Line Tracing");
  16.  
  17. }
  18. void loop(){
  19.   L=analog(1);R=analog(2);speed=knob(100);
  20.   if(L>850&&R>850){fd(speed);}
  21.   else if (L<850&&R>850){while(analog(1)<850){sl(speed);}}
  22.   else if (L>850&&R<850){while(analog(2)<850){sr(speed);}}
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement