Cik-cak.nxc

From RoboWiki
Revision as of 10:23, 26 March 2008 by Palo (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Krúžok Robotiky

/*

	This program serves NXC driving ZIG-ZAG
*/


#define TURN_TIME 360
#define Both_Motors OUT_AC
#define Left_Motor OUT_A
#define Right_Motor OUT_C

task main()
{
    for(i=0;i<12;i++)
     {
      OnFwd(Both_Motors,50);
      Wait(1500);
      
      if((i/2)==0)
        Float(Left_Motor);
      else
        Float(Right_Motor);
        
      Wait(TURN_TIME);
     }
     Float(Both_Motors);
}