by gloomyandy » Sat Oct 27, 2007 7:35 pm
Hi Brian,
Sort of! When in continuous mode the new code ensures that there is at least a 5ms delay between commands (as required by the sensor). It only adds the needed delay. So if you make a call to one of Ultrasonic apis and then do something that takes say 2ms then the code will add a delay of 3ms to make sure things work. If the user code takes more than 5ms then the sensor code will not insert a delay...
If you ask for data more often than every 15ms it simply returns the latest value (and does not bother to ask the sensor, since this is what you would get anyway) So you can call it as often as you like and you will get the data as it becomes available. But you may as well delay by 15ms or so to save the cpu... I did consider building in a delay but I thought it was better to leave this under the control of the caller...
Andy