EFeru / hoverboard-sideboard-hack-STM

Hoverboard sideboard hack for STM32 boards
GNU General Public License v3.0
49 stars 42 forks source link

Question: How to use this standing instead of lying #5

Closed zengtronic closed 3 years ago

zengtronic commented 3 years ago

Hello, how do i change the code to use the sideboard standing | instead of lying __ (regarding to MPU6050 chip orientation)?

I found following piece of code in MPU6050.c Line 55: static signed char MPU_ORIENTATION[9] = {1, 0, 0, // [-] MPU Sensor orientation matrix: set this according to the sensor installation 0, 1, 0, 0, 0, 1};

but find nowhere a definition or tutorial what i need to change.

Also is in the MPU6050 part no function to set the offsets? found nothing useful until yet.

BTW: I think the processing example in the end of the Readme is broken ;) It worked for me after i changed the array indexes from 2, 4, 6 to 1, 3, 5 (https://github.com/EFeru/hoverboard-sideboard-hack-STM/blob/master/docs/sketch_processing/sketch_processing.pde line 86++)

zengtronic commented 3 years ago

Found something regarding the chip orientation... https://teksab.wordpress.com/2014/11/27/mpu6050-part-1/

I will try this.

EFeru commented 3 years ago

I think for the orientation you have to find it by trial and error. I don't have information on that. However, in the repo below, it was mimicked the orientation in factory hoverboard (MPU6050 upside down). He used this matrix: https://github.com/yashatan/hoverboard-sideboard-firmware-hack-Fuzzy/blob/75d3ef106a004c8c8a6b4f6f4437a79f1c5ae03d/hoverboard-sideboard-hack-GD-Fuzzy/hoverboard-sideboard-hack-GD-master/Src/mpu6050.c#L48

And you are right the Processing examples are Brocken because of a change in the serial structure. If you fix it, I would appreciate a pull request ;)

EFeru commented 3 years ago

You found a link already. Nice!