mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-16 11:21:18 +03:00
Restored and updated SoftwareSerialExample -- really this time!
This commit is contained in:
@ -0,0 +1,21 @@
|
||||
#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.write(mySerial.read());
|
||||
if (Serial.available())
|
||||
mySerial.write(Serial.read());
|
||||
}
|
Reference in New Issue
Block a user