Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

Serial Print to a device

$
0
0

All,

I have a gps device that outputs several other sensor readings (wind, heading, ect.). All of those strings are output in NMEA format strings. I am able to read these strings and also (with the TinyGPS library) I can parse them to pull what I need.

Now the problem,

I want to be able to send NMEA strings back at the device in order to tell it to output different NMEA string types.

For example, sending "$PAMTC,EN,HDG" should enable the "$HCHDG" string on the device. Or sending "#PAMTC,QV" should query the software version number.

My code to read from the device is:

Code: [Select]

void setup()
{
  // put your setup code here, to run once:
  Serial.begin(4800);
  Serial1.begin(4800);
}

void loop()
{
  // put your main code here, to run repeatedly:
  char c;
  
  c = Serial1.read();
  Serial.print©;
  
}

"Serial" is to print to the computer serial monitor. "Serial1" is to read from the device.  My board is a MSP430FR5969 launchpad. 

Any help would be appreciated.


Viewing all articles
Browse latest Browse all 2077

Trending Articles