Quote:
Originally Posted by Ether
Why did you need an ISR to handle this? Was 20ms not fast enough?
|
Our kicker rotated and launched outward when the kick button was pressed. The rotations were at an extremely high speed. To prevent the kicker from coming out at an unpredictable and generally unfavorable angle, we used the sensor as an interrupt to make sure the kicker could come out at a predictable angle. As the speed of the rotator increased, the range of angles for a good kick decreased, so the room for error in the timing of the code wouldn't allow for timing of the kick to occur in the main loop. The interrupt checks a flag for whether to kick, and also will delay the kick as needed to compensate for the speed of the kicker (without the extra timing code, the kicker only works around 75% power)
__________________

"To have no errors would be life without meaning. No strugle, no joy"
"A network is only as strong as it's weakest linksys"