2012年12月20日 星期四

Spin the car with NXC

Spin the car with NXC


Please building a basic car first.

We will let the car spin in this project by NXC. The basic method is letting the left motor and right motor turn inversely.  The function: OnFwd can control the motor to turn inversely by letting the power be negative.  In the example, we will let the motor A and C turn inversely for 1 second.

task main(){}, OnFwd(P,p), Wait(ms), Off(P) will be use in this project.

Example:


task main()
{
OnFwd(OUT_A,100);
OnFwd(OUT_C,-100);
Wait(1000);
Off(OUT_AC);
}