Hi
I've been poking around with a bluetooth module and a 10DOF IMU.
I've managed to send the joystick values (from a gamepad connected to the computer) to the arduino via bluetooth using Processing, and to read the inclination angles from the IMU using this Kalman filter.
This was done in two separate projects, while I tried to learned how this works (still unsure if it's the best approach, but it was working.... until now). When I merged the two projects, it stops working. The Wire.endTransmission() returns an error 4. I read somewhere this may have to to with too much interrupts, but i'm not sure.
I read the bluetooth values using just this:
if (bluetooth.available() >= 4) {
last_command_time = cur_time;
stick_l.x = bluetooth.read();
stick_l.y = bluetooth.read();
stick_r.x = bluetooth.read();
stick_r.y = bluetooth.read();
bluetooth.write('A'); // Asks for values (The processing code sends the new values when it detects an incoming byte from the arduino)
}
Where bluetooth is a SoftwareSerial port.
Can anyone help em troubleshoot this? And if someone has a better way to send the computer commands to the arduino via bluetooth, it is also welcome. This way sometimes the leds flicker, meaning it isn't transmitting flawlessly :s
Thanks in advance ![]()