arduino-at-09
arduino-at-09 copied to clipboard
Fixed timing issue
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.
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 ?
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!