|
Counter & DT
Posted by Joe Johnson.   [PICTURE: SAME | NEW | HELP]
Engineer on team #47, Chief Delphi, from Pontiac Central High School and Delphi Automotive Systems.
Posted on 1/22/2000 4:59 PM MST
In Reply to: Programing help... posted by Adam Anderson on 1/22/2000 2:07 PM MST:
I have not looked at the code this year, but I think that the concept is still the same in 2000.
Basically, your data packet sent by the operator interface has a time stamp that tells you how many data packets have gone by since the last time you got a data packet.
Actually, I think that it is a combination of the operator interface CPU and the 'Master' CPU on the robot interface that puts in the DT into the data packets available to the 'Slave' CPU (the Basic Stamp 2 chip).
Anyway, to implement a kind of rough timer, you can increment or decrement a counter by DT every time through the loop.
As to the exact time through the loop, this is not as easy as it might seem. One way to get an estimate is to have the counter count to 1000 or so and then time that. If you have an oscilliscope then all you have to do is toggle an output each time through the loop and read the time directly. Other methods exist as well.
A word of caution: If your program depends on precise timing you may be asking for trouble.
Good luck.
Joe J.
__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.
|