2 Software serial multple serial test
4 Receives from the hardware serial, sends to software serial.
5 Receives from software serial, sends to hardware serial.
8 * RX is digital pin 10 (connect to TX of other device)
9 * TX is digital pin 11 (connect to RX of other device)
12 Not all pins on the Mega and Mega 2560 support change interrupts,
13 so only the following can be used for RX:
14 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69
16 Not all pins on the Leonardo support change interrupts,
17 so only the following can be used for RX:
18 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).
20 created back in the mists of time
23 based on Mikal Hart's example
25 This example code is in the public domain.
28 #include <SoftwareSerial.h>
30 SoftwareSerial mySerial(255 , 10); // RX, TX , optional inverted logic // so here use only pin 10 as output to send the bytes
34 // Open serial communications and wait for port to open:
36 Serial.println("Serial setup");
38 // set the data rate for the SoftwareSerial port used is read mode
42 void loop() // run over and over
44 mySerial.begin(19200); // set the data rate for the SoftwareSerial port used is read mode
46 mySerial.write(0x80); // byte to says it is a binary format
47 mySerial.write(0x8D); // byte to say it is a GAM (general air module)
49 mySerial.end() ; // set pin in high impedance (I hope)
50 delay(190) ; // wait 200 msec to let the sensor answer.
52 mySerial.begin(19200); // set the data rate for the SoftwareSerial port used is read mode
54 mySerial.write(0x80); // byte to says it is a binary format
55 mySerial.write(0x8A); // byte to say it is a GPS
57 mySerial.end() ; // set pin in high impedance (I hope)
58 delay(190) ; // wait 200 msec to let the sensor answer.