void auto_raw(void)
{
	//while there is not a button pressed
	while(!(UCSR0A & (1 << RXC0)))
	{
		//prints the raw vaues with a '$,' start and ',#' end	
		printf("$,");
		printf("%d,", x_accel());
		printf("%d,", y_accel());
		printf("%d,", z_accel());
		printf("%d,", x_gyro());
		printf("%d,", y_gyro());
		printf("%d,", z_gyro());
		magnetometer();
		printf("%d,", x_mag);
		printf("%d,", y_mag);
		printf("%d,", z_mag);
		printf("#\n\r");
	}

	//if a button is pressed and that button is ctrl-z, reset autorun, display menu
	if(uart_getchar() == 0x1A)
	{
		write_to_EEPROM(10,0);
		config_menu();
	}
	
	auto_raw();
}
Exemple #2
0
void raw(void)
{
	//prints the raw values with a '$' start and '#\n\r' end
	printf("$");
	printf("%d,", x_accel());
	printf("%d,", y_accel());
	printf("%d,", z_accel());
	printf("%d,", x_gyro());
	printf("%d,", y_gyro());
	printf("%d,", z_gyro());
	
	//at least 100ms interval between mag measurements
	if(num_sent % 10 == 0)
	{
		magnetometer();
	}
	
	printf("%d,", x_mag);
	printf("%d,", y_mag);
	printf("%d", z_mag);
	printf("#\n\r");
	
	if(num_sent == 9)
	{
		num_sent = 0;
	}
	else
	{
		num_sent++;
	}
	
	delay_ms(10);
}
void stgyros(void)
{
	
	printf("x= %4d, ", x_gyro());
	printf("y= %4d, ", y_gyro());
	printf("z= %4d \n\r", z_gyro());

	//delay_ms(300);
}
Exemple #4
0
void print_itg3200(void)
{
	
	printf("x= %4d, ", x_gyro());
	printf("y= %4d, ", y_gyro());
	printf("z= %4d\n\r", z_gyro());

	delay_ms(20);
}
void raw(void)
{
	//prints the raw vaues with a '$,' start and ',#' end
	printf("$,");
	printf("%d,", x_accel());
	printf("%d,", y_accel());
	printf("%d,", z_accel());
	printf("%d,", x_gyro());
	printf("%d,", y_gyro());
	printf("%d,", z_gyro());
	magnetometer();
	printf("%d,", x_mag);
	printf("%d,", y_mag);
	printf("%d,", z_mag);
	printf("#\n\r");
}