Memsic2125 theta question
MacGeek117
Posts: 747
I've been trying to Spin without a Prop and have moved on to the Memsic 2125 driver, but my project needs the theta values for forward, back, left, and right. Could someone please post the values for those directions?
RoboGeek
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"I reject your reality and subsitute my own!"
Adam Savage, Mythbusters
www.parallax.com
www.goldmine-elec.com
www.expresspcb.com
www.startrek.com
·
RoboGeek
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"I reject your reality and subsitute my own!"
Adam Savage, Mythbusters
www.parallax.com
www.goldmine-elec.com
www.expresspcb.com
www.startrek.com
·
Comments
I am not exactly sure what you are asking?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
RoboGeek
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"I reject your reality and subsitute my own!"
Adam Savage, Mythbusters
www.parallax.com
www.goldmine-elec.com
www.expresspcb.com
www.startrek.com
·
BRADS are "Byte radians" ... Simply a way to represent 0-360 deg within a BYTE value ranging from 0-255
BRAD = (DEG / 360) * 255
..or for integer math...
BRAD = DEG * 255····· <--- For the Propeller (360 * 255) would not be an overflow problem
BRAD = BRAD / 360
Applying the above formula...
The RAW theta values in the object I posted are returned as a 32-bit value but need to be shifted right 19 places
to create a valid 13-bit value that ranges from 0 to 8192 ($0-$1FFF)
deg := acc.theta >>19
Brads := deg * 255 / $1FFF
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
RoboGeek
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"I reject your reality and subsitute my own!"
Adam Savage, Mythbusters
www.parallax.com
www.goldmine-elec.com
www.expresspcb.com
www.startrek.com
·