I receive the following:
09:27:10.618 -> 0 0
09:27:12.589 -> 0 0
09:27:14.616 -> 0 0
09:27:16.622 -> 0 0
09:27:18.576 -> 0 0
09:27:20.577 -> 0 0
09:27:22.583 -> 0 0
09:27:24.606 -> 0 0
09:27:26.571 -> 0 0
09:27:28.612 -> 0 0
09:27:30.585 -> 0 0
09:27:32.582 -> 0 0
09:27:34.564 -> 0 0
09:27:36.563 -> 0 0
09:27:38.587 -> 0 0
When I use the following codes: For sending:
#include <SPI.h>
#include <SoftwareSerial.h>
SoftwareSerial Serial1(0, 1);
char mystr[6] = "Hello"; //String data
void setup() {
// Begin the Serial at 9600 Baud
Serial1.begin(9600);
}
void loop() {
Serial1.write(mystr,6); //Write the serial data
delay(1000);
}
For receiving:
char mystr[10]; //Initialized variable to store recieved data
void setup() {
// Begin the Serial at 9600 Baud
Serial.begin(9600);
}
void loop() {
Serial.readBytes(mystr,6); //Read the serial data and store in var
Serial.println(mystr); //Print data on Serial Monitor
delay(1000);
}
Why don't I get my hello string? NOTE: When I changed to Serial1 for the receiver code I now receive nothing. Not sure why it doesn't work.
int l = Serial.readBytes(buff, len); buff[l] = 0;
if (Serial1.available()) Serial.write(Serial1.read());