![]() ![]() While the board has been proven electrically compatible with the 3.3v raspberry pi (without level shifters), the code out there to support it wasn't written by me but by someone else for the 1.0 boards. Earlier boards used OR logic on the echo and the SonarI2C library. ![]() NOTE: The OctoSonar library is for board rev 2.0+. If you need to wait for something to happen or be a certain way for a period of time, save the end time in a variable and check each loop() cycle to see if it is time to end that state. Essentially you want your loop() to never delay(). Google it if you don't know what that is. IMPORTANT: this will work best if your program is written as a "finite state machine". If it is time to poll the next sensor it will do that. The user read functions default to mm, but you can use other units.Ĭall doSonar() every loop(). Sensor data is kept in an array which is cycled through in 50ms steps Record an out-of-range value if no echo completion occurred.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |