root/2009_cbc_hacking/nhs_installer/stop.c

User picture

Author: Jeremy Rand

Revision: 1


File Size: 347 Bytes

(August 18, 2009 17:14 UTC) Almost 3 years ago

Code for the 2009 CBC Hacking GCER paper.

 
Show/hide line numbers
int main()
{
	int motor_port = 0;

	printf("Restoring state to default....\n");
	
	// Disable servos
	disable_servos();
	
	// Turn off motors
	alloff();
	
	// Restore motor PID settings
	for(motor_port = 0; motor_port <= 3; motor_port++)
	{
		set_pid_gains(motor_port, 30,0,-30,70,1,51);
	}
	
	printf("Default state restored.\n");
	
	return(0);
}