Step 41: Code for use with new 6dof DIGITAL IMU from Sparkfun
I have looked at the Sparkfun 6dof Digital IMU and tried to incorporate code to read the digital output from this into my existing self balance code. Did not want to do it, but this is coming so someone has to have to have a go else nobody will build any more hobby self-balancing machines.
I have used code from the web, full wiring instructions and orientation instructions are given in the attached arduino sketch.
Code to read the IMU came from here:
I have built it into my existing code for a self balancing 2 wheeler that uses rocker switches or buttons for steering and adjustment of balance point.
It is set up at present so you can test it with the IMU attached to an Arduino watching the outputs on an attached computer.
If you want to run it in a real machine then there is a section of code to comment out which then enables all the buttons including the deadman switch.
At present I am using pulldown resistors to GND on the button input pins as in my original instructable here.
NOTE: Unfinished. Not sure if even works but is here as a start for others to work with.