4 years, 11 months ago.

mbed Equivalent of Arduinos serial.read for the Adafruit FONA 808 breakout board

Does anybody know the best mbed equivalent to arduinos serial.read? (and how to use / set it up)

I am using the Adafruit FONA 808 breakout, which takes certain commands in order to function.

I am sending these command through the serial port and trying to read the response io putty.

I have tried scanf(), and puts with no luck.

The user guide for the breakout is: https://cdn-learn.adafruit.com/downloads/pdf/adafruit-fona-808-cellular-plus-gps-breakout.pdf

1 Answer

4 years, 11 months ago.

Commands for this type of modem are usually Hayes AT strings. You can send them to a serial port through formatted ''printf' or ''sprintf''' methods. Look up some mbed libs for ESP8266 for example code. Reading back data from the modem or GPS is often done using the serial port ''getc'' to receive individual characters which are then stored in a string and parsed using the stdio token parsers. Check out one of the mbed GPS decoder libraries.