View Full Version : Help with calculating code overhead

01-23-2011, 06:33 PM
I'm working on Robotics with Boe-Bot and I'm at the point of ControlServoRunTime.bs2 on page 83.
The equation for figuring out how many pulses I will need gives a figure of 1.6ms as code overhead.
How is that number obtained? While writing the program I put in 2 DEBUG ? counter lines so I could see it counting and the servos ran twice as long as they were suppose to. It took a little time for me to figure out why they were running longer and when I removed the line they ran correctly.

How would I calculate the figure for something like that?

Thanks for any help


01-23-2011, 06:53 PM
This page -- emesystems.com/BS2speed.htm (http://emesystems.com/BS2speed.htm) -- has timing characteristics of most Stamp commands. You can use this for calculating approximate code time overhead.

That said, when playing with inserted pauses in routines that generate servo pulses, trial and error and a little experimenting can be just as quick :)