At the beginning of this year, I decided that I was going to make a bunch of electronics balance on 2 wheels. gahhh
Im using an Arduino Uno with a MPU6050 and an Odrive motor controller that is controlled using two PWM pins from the Arduino. I am also trying to use "pulseIn(5, HIGH, 25000);" to accept two more signals from my radio receiver.
the library that I'm using for the MPU6050 is using an interrupt pin and is enabled for DMP, it is called
#include "I2Cdev.h"
#include "MPU6050_6Axis_MotionApps20.h"
Im using the MPU6050_DMP6 example
Right now, the problem is as follows:
1.When I output values VIA "Left.writeMicroseconds(writespeed+Steer);" it messes up the values that I get back from the MPU6050. -- UPDATE-- This problem is just electrical noise screwing with... something. it goes away with the Odrive motor controller powered off.
- When I read my radio receiver VIA "pulseIn(5, HIGH, 25000);" that causes the Gyro reading sketch to completely stop reading the area of the code that was left for non-gyro purposes.
is this something to do with Arduino's available timers?
In case you're wondering why I'm using the DMP sketch, it's because the data that I get back from it, (assuming that I don't adulterate the program with my stuff) is soo beautiful and accurate, regardless of the boot orientation the machine finds out where it needs to be and goes there, but as soon as I try to write to the motor controller or read from the RC receiver it all goes to ... well
what do I do! i've been screwing with this thing for a month now... haha
thanks in advance
BalanceCarMakeWork copy.zip (5.1 KB)