Hi, Picatchu
nice code template ... easy to read !
some tricks :
Code:
if (PORTB.0 = rb0old) then goto changetest ' If there is no change then test again
change for :
Code:
While (PORTB.0 = rb0old)
Wend
this will loop till a change occurs ... ( much faster ! )
Note here I did not understand why use the "change" feature : from your explanations ... if "back" signal detected, it simply turns PortB.0 input ON ( ... or OFF depending Hardware)
Code:
dummy = (time((6 * temp)+ 3300)) ' calculate part of the full calculation
to me ( I can fail ...)
it might be :
Code:
dummy = (time*((6 * temp)+ 3300)) ' calculate part of the full calculation
By the Way : Speed of sound in air = SQR ( 13 * 287* (273.15 + Temp) /10 )
... @ sea level ...
...
Alain
PS: May be you could try a "samples" request here ...
http://www.midascomponents.co.uk/
Bookmarks