Skip to content
Snippets Groups Projects
Commit 83242210 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Modified the sensors example to use the BNO055 IMU.

parent 77313c1e
No related branches found
No related tags found
No related merge requests found
...@@ -14,7 +14,11 @@ void user_init(void) ...@@ -14,7 +14,11 @@ void user_init(void)
balance_enable_gyro(); balance_enable_gyro();
user_time_set_period(100); user_time_set_period(100);
exp_adc_start(); exp_adc_start();
exp_compass_start(); exp_bno055_start();
if(is_button_pressed(BTN_UP))
exp_bno055_erase_calibration();
while(exp_bno055_is_calibrated()!=0x01)
_delay_ms(100);
} }
void user_loop(void) void user_loop(void)
...@@ -37,9 +41,8 @@ void user_loop(void) ...@@ -37,9 +41,8 @@ void user_loop(void)
else else
state=read_sensors; state=read_sensors;
break; break;
case read_sensors: cm510_printf("CM510 ADC port 1: %d\n",get_adc_avg_channel(ADC_PORT_2)); case read_sensors: if(user_time_is_period_done())
cm510_printf("Exp. Board compass: %d\n",exp_compass_get_avg_heading()); cm510_printf("%d\n",exp_bno055_get_heading());
cm510_printf("Exp. Board ADC port 7: %d\n",exp_adc_get_avg_channel(ADC7));
break; break;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment