#include <SoftwareSerial.h>
// Set up a new SoftwareSerial object with RX in digital pin 2 and TX in digital pin 3
SoftwareSerial mySerial(2, 3, false);
String rcv;
void setup() {
// Set the baud rate for the SerialSoftware object
mySerial.begin(9600);
Serial.begin(9600);
}
void loop() {
// Read the analog value on pin A0
// Print analogValue in the Serial Monitor in many formats:
mySerial.print(">B:");
if (Serial.available() > 0) {
// read the incoming byte:
rcv = Serial.readString();
// say what you got:
Serial.print(rcv);
}
// Pause for 100 milliseconds before the next reading
delay(100);
}