Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years, 3 months ago.
Why do all programs that use additional libraries (eg GPS libraries) become "blinky"?
Just printing an integer number to serial works fine. But when I load a program (that compiled w/o errors or warnings) that uses for example a GPS library (GPS.h, AdafruitGPS.h and also TinyGPS.h) they turn into "Blinky". Does anybody have an idea as to why this might happen?
Thank you for your input...
Here's my code :
TinyGPS example
#include "mbed.h" #include "TinyGPS.h" #define TX0 P2_14 #define RX0 P2_15 #define TX5 P8_11 #define RX5 P8_13 Serial Serial0(TX0, RX0); Serial GPSSerial(TX5, RX5); TinyGPS tgps; int i = 0; int main(void) { // setup GPSSerial.baud(9600); wait(0.001); Serial0.baud(115200); wait(0.001); while(1) { while(1) { if( !GPSSerial.readable() ) { break; } char c = GPSSerial.getc(); Serial0.printf("%c", c); } Serial0.printf("%d\r\n",i); i++; wait(1.0); } }
Question relating to:
1 Answer
8 years, 3 months ago.
Often when the LED starts blinking very fast it comes with a message over the serial port that says "Pinmap not found for peripheral". This happens when you wrongly declare a pin (e.g. declare a TX pin as RX).
According to the pinout P8_11 is RX and P8_13 is TX, but in your code you switched them around.