Go Down

Topic: Pulsin - Value Range (Read 1 time) previous topic - next topic


Hi there.

I've successfully integrated a "Memsic 2125 Dual-axis Accelerometer" with the mini board.  I got Pulsin working but it gave a strange value range.  The value when the sensor was flat was 0 and the left 0 -> 2000,  but when you turn the sensor the over way it gave the value 4000 -> 2000.   I've tried sign and unsign int but this makes no difference.  I've looked in FAQ and google but still can't find anything.

I'm trying to use this accelerometer to control two servos (keep a camera flat) and find this range hard to handle easily to keen the platform flat.  In the end I coded a simple routine to count how long the pins stays high and got it working that way.

I would still like to use the Pulsin as it would simplify my code.

So the Question, how can I change the range of the Pulsin to something like 0 - 5000 where 2500 is the middle. (with little code otherwise I will just keep the current working code).

Thanks Bren

Go Up