mirror of
https://github.com/arduino/Arduino.git
synced 2024-12-12 23:08:52 +01:00
22 lines
448 B
Plaintext
22 lines
448 B
Plaintext
|
#include <SoftwareSerial.h>
|
||
|
|
||
|
SoftwareSerial mySerial(2, 3);
|
||
|
|
||
|
void setup()
|
||
|
{
|
||
|
Serial.begin(57600);
|
||
|
Serial.println("Goodnight moon!");
|
||
|
|
||
|
// set the data rate for the SoftwareSerial port
|
||
|
mySerial.begin(4800);
|
||
|
mySerial.println("Hello, world?");
|
||
|
}
|
||
|
|
||
|
void loop() // run over and over
|
||
|
{
|
||
|
if (mySerial.available())
|
||
|
Serial.print((char)mySerial.read());
|
||
|
if (Serial.available())
|
||
|
mySerial.print((char)Serial.read());
|
||
|
}
|