arduino-at-09 icon indicating copy to clipboard operation
arduino-at-09 copied to clipboard

Fixed timing issue

Open mtelvers opened this issue 5 years ago • 2 comments

Following the blog at https://medium.com/@yostane/using-the-at-09-ble-module-with-the-arduino-3bc7d5cb0ac2 I was unable to get past even the simplest AT test. I thought my module was faulty!!! It turns out that mySerial.available() is called too quickly after println("AT") so there is no data to be read and the sketch never checks again. I've moved the check into the loop so it is continually called.

mtelvers avatar Mar 11 '20 15:03 mtelvers

Hi, Thanks for the MR. If the reading is done in the loop function, maybe we can replace while by if ? What do you think ?

yostane avatar Mar 30 '20 19:03 yostane

Hi, Yes, you sure could. Doesn't make much difference in such a short loop but if the code was extended I guess I'd prefer the while syntax to get all the serial data before the buffer was lost but you could also argue that the other way as well depending upon what else your loop was doing!

mtelvers avatar Mar 30 '20 20:03 mtelvers