AndersNyman
New Member
Hi!
I have a picaxe 28x1 and a 3 axis gyro from sparkfun.
I want to remap the signal (-inf to inf) so I can prevent flipping.
The method that appears to me is something like this:
thisFrame = gyroSignal
rotationTable = 0
if thisFrame < 30 and lastFrame > 220:
Is there a nicer way to do this?
/Anders
I have a picaxe 28x1 and a 3 axis gyro from sparkfun.
I want to remap the signal (-inf to inf) so I can prevent flipping.
The method that appears to me is something like this:
thisFrame = gyroSignal
rotationTable = 0
if thisFrame < 30 and lastFrame > 220:
rotationTable += thisFrame-lastFrame-255
elif thisFrame > 220 and lastFrame < 30:rotationTable += thisFrame-lastFrame+255
else:rotationTable += thisFrame-lastFrame
lastFrame = gyroSignalIs there a nicer way to do this?
/Anders