For the 2024 season, we are using two accelerometers (MPU-6050), this will communicate with an Arduino UNO over the
Example code was taken from this website
This code should be uploaded to a microcontroller that is able to use/access the
What you will need:
- Arduino UNO
- USB type B cable
- 2 x MPU-6050
- Jumper wires
- (Bread Board)
With these parts, you will be able to create a table test for the program and you can adapt to whatever your use case is
Because
If you followed everything correctly, this should result in the angles being output from the serial bus. You can modify which axis is being output from changing the funciton being called for inside of the if statement of the loop function.
Similar code was experimented with the Raspberry Pi Pico, but it appeared to have not as great performance as the Arduino UNO
If you want to change the axis from one to the other, change the function being called. In this example, you would change angleXY / angleZY to whatever you want
void loop() {
for (int i = 0; i < 2; i++) {
...
if (i == 0)
test = angleXY(accelerometer_x, accelerometer_y);
else if (i == 1)
test = angleZY(accelerometer_z, accelerometer_y);
...
}
}