|
The PICstartPlus package is excellent. I got one several years ago, and cant say enough good things about MicroChip, their uPs, their tools.
It amazing what you can do with their uPs. From the little 8 pin ones, up to the 40 pin DIPs. If anything, they are a little more expensive than other microcontrollers, but if you are building small quanitiies of stuff, the ease of use is worth the few extra dollars.
BTW - I went to Dean Kamens house during the kickoff a few years back, and smiled when I saw the PIC box on a shelf in his library :c)
We had thought about doing an external circuit to turn the Gyro into an absolute heading signal, and realized all you have to do is accumulate the output value (normalize it by subtracting 127) in a 16bit variable - just add it on every loop, and if deltaT is = 1, add it again.
Since the loop in your SW is running at a (deterministic) fixed rate - by accumulating it in a 16bit variable, you are in effect multiplying the degrees/second signal by the cycle period (seconds) and you end up with a 16bit value that is directly proportional to the number of degrees the robot has turned since you powered it up.
We us it in our code to determine when we have turned 45° in auton mode - 45° comes out to be around 3000.
|