I need a way to set a timeout for the RCTIME command since it takes 131ms for it to timeout itself and I need to refresh several servos every 20ms. Is there a way around this?
· It can take up to 130msec, but it doesn't have to -- that all depends on the values of R and C.· For very short periods (time = R x C) it's less than that.·
· Try selecting values so that time will be shorter (R x C·< 10msec.)
·Update -- From PBASIC Help: When RCTIME executes, it starts a counter... It stops this counter as soon as the specified pin is no longer in State (0 or 1).
The short answer is that there is no way to set a timeout for the RCTIME command. PJ Allen's suggestion is a practical solution to the need to refresh servos every 20ms. If you're willing to use some external circuitry, you could use a 555 timer to short out the capacitor when 20ms have gone by and terminate the RCTIME if you use the capacitor's discharge voltage to trigger the RCTIME.
Comments
· Try selecting values so that time will be shorter (R x C·< 10msec.)
· Update -- From PBASIC Help: When RCTIME executes, it starts a counter... It stops this counter as soon as the specified pin is no longer in State (0 or 1).
Post Edited (PJ Allen) : 7/15/2007 2:03:31 AM GMT