I am finding that the pitch and roll rotation blocks seem to be working backwards with MakeCode on the CPX (and on more than one board I've tried it with). In other words, pitch registers movement side to side and roll measures tilt forward and back. Is this just me?
Background: This is a continuation of questions regarding documenting Tilt Maze project I created for students I teach at their homes through Zoom. I am using the CPX as a tilt controller to activate two servo motors -- one that tilts the board side to side, and the other tilts it forward and back. It works with the INPUT blocks, but not when I try to map the CPX tilt to the servo movement. Here's the previous thread: viewtopic.php?f=64&t=190909
It is a MakeCode version of this Circuit Python learning guide by Dano Wall: https://learn.adafruit.com/tilt-controlled-marble-maze
Pitch vs Roll on the CPX
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- KathyCeceri
- Posts: 54
- Joined: Sun Mar 02, 2014 7:30 pm
Re: Pitch vs Roll on the CPX
FYI, I just found a GitHub thread from 2018 that says pitch and roll were reversed with MakeCode on the micro:bit board: https://github.com/microsoft/pxt-microbit/issues/1075
- johngale
- Posts: 13
- Joined: Mon Jan 26, 2015 6:37 pm
Re: Pitch vs Roll on the CPX
I have the same issue, and also my "roll" is at 0 only if the board is upside down. If it's sitting flat, it jitters between "180" and "-179". For my project, I use the acceleration block instead, and divide the milli-g sensor reading by 10, and that's close enough, since I'm not "pitching" or "rolling" past +/- ~30 degrees or so, and it's just to puppet some servos, so doesn't have to do trig to get accurate degrees.
Please be positive and constructive with your questions and comments.