예제 #1
0
void cmdslow(void) // Moves motors forward at half duty
{
	motor_left_duty(15);
	motor_right_duty(15);
	motor_left_forward();
	motor_right_forward();
}
예제 #2
0
void cmdBangBang(void)
{
	motor_init();
	motor_left_stop();
	motor_right_stop();

	motor_left_duty(20);
	motor_right_duty(40);
	motor_left_forward();
	motor_right_forward();
	while(1)
	{
		// start turning left
		motor_left_duty(20);
		motor_right_duty(40);
		myStringPut("Bang Left");
		myNLPut();
		while (line_status() == WHITE) // WHITE
		{
		}
		// Hits Black

		// Turns right
		motor_left_duty(40);
		motor_right_duty(20);

		myStringPut("Bang Right");
		myNLPut();
		while (line_status() == BLACK) // BLACK
		{
		}
	}
}
예제 #3
0
void cmdforward(void) // Moves motors forward at full duty
{
	myStringPut("calling cmdforward");
	myNLPut();
	motor_left_duty(100);
	motor_right_duty(100);
	motor_left_forward();
	motor_right_forward();
}
예제 #4
0
void motor_turn_right(){
	motor_left_forward();
	//servo_disable(PIN_RIGHT_SERVO);
	SetBit(PORTC,PIN_RIGHT_FORWARD);
	SetBit(PORTC,PIN_RIGHT_BACKWARD);
}
예제 #5
0
void motor_spin_right(){
	motor_right_backward();
	motor_left_forward();
}
예제 #6
0
void motor_forward(){
	motor_right_forward();
	motor_left_forward();
}