The arduino and processing code is already completed but there is still a small minor mistake on the pitch and roll calculation. I need the 3d cube able to rotate according to the accelerometer.
Hello I am electronic engineer expert in inertial system and programming in arduino and processing, I also did a work very similar sending quaternions for draw the movement of a rectangle.
I have a fair amount of experience using accelerometers and gyroscopes with ardiuino. If you let me have a look at your code I think I can find your problem.