Sorry, I am a programming novice.
I’m using newsoftserial to read an electronic compass that outputs a NMEA statement: $HCHDM, 240.2, M*27
that I can now read on the serial monitor. It took forever to figure out so I am quite pleased.
Now I need a suggestion (a starting place) for extracting the numbers between the commas 240.2 in the statement above so they are available as a single variable.
Any suggestion would be gratefully received!
Here is “my” code:
NewSoftSerial mySerial(2, 3, true); // RX here is receive pin 2; TX pin 3
Serial.begin(4800); // this is the rate the computer talks to the arduino
// set the data rate for the NewSoftSerial port
mySerial.begin(4800); // default rate is 4800 bps
void loop() // run over and over again
aa= mySerial.read(); // get the byte of data
Serial.print(aa); // send it to the serial monitor