>
> Hi, I would like to know why the latency in one while loop is very big.
> Heres the snippet:
> While (Echo == 0)
> // TICS prescale set to 2
> {
> If (TICS.MSB == 1 And Echo == 0)
> {
> Count = TICS.Count;
> If (Count < 65535)
> {
> Count = Count+65535;
> }
> //Print.Clear;
> Print.Locate(1,0);
> Print.VString = "timeout " + Str$(Count) + " " + Str$((Count / 10)
> * 8) + " us";
> Timeout = 1;
> Break;
> }
> }
>
> I'm making an home-made ultrasonic ranger, which requires the use of
> the OOPic and as much preciseness as it can be. For example, just for
> this to loop once, TICS will increase by 2000 counts. is that normal?
> Would writing this in Visual Basic have better results?
>
> Thanks.
>
> Ray Xu
> rayxu@...
>
You need to think in terms of 300 lines per SECOND for code execution.
What happens to your resolution if each line takes 30 mS (or more!)?
I haven't tried this with a virtual circuit but I'm not convinced the
resulution will be sufficient even with this approach.
Sound moves about 1100 feet per second or about 33 feet for each line
of code.
To measure to an accuracy of 1 inch, you need to be able to resolve 76
microseconds. That's pretty easy with a hardware timer but I'm not
sure how to do it with the OOPic.
Richard
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/oopic/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/oopic/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
No comments:
Post a Comment