I am integrating a Ping1d on a Teensy (think: powerful Arduino) based breakout. There are quite few different UART- and I2C-interfaces (Servos, ESC, battery) running on the board and all are scheduled in little cyclic tasks. In order to maintain consistent timing behaviour, I generally use an approach like this:
- Send command to hardware_xx requesting feedback
- Do something else - while in the meantime, hardware_xx replies
- Parse UART buffer for hardware_xx
- Do yet something else and eventually repeat overall progress
The Arduino-lib for Ping1D contains a delay() inside the update(), which sort of breaks the system’s timing. So I was looking through the lib for obvious ways to break Ping1D-interfacing into this Request →Parse → Request →Parse→etc.-structure.
There is indeed the ping.request(…) method in the library, but it also appears to include a delay() in side. So it is not what I need - I believe… So the question is essentially, if I am overlooking some very obvious solution? Or has someone faced the same problem and solved in a very elegant way?