Hi,
I need help with serial communication using when using a Nano Every.
I've written two simple programs to communicate using serial hardware between two Arduinos. Initially two Arduino Unos were used with Uno1 set up as a master and Uno2 set as a slave. The master sends either a 0 or 1 to the slave. if the slave receives a 0, a LED turns off. If the slave receives a 1, a LED turns on. When using two Unos, everything works correctly. When using a Nano Every as the master and Uno as the slave, the LED never turns on. Why?
6 pictures are attached showing the hardware used and explaining the wiring. Picture 1-5 show the Uno and Nano Every hardware. Picture 6 shows the Uno and Uno hardware.
When code is uploaded to a Uno, the upload sequence end cleanly--no errors.
When code is uploaded to the Nano Every, the following error is reported (see attachment picture 7): avrdude: jtagmkII_initialize(): Cannot locate "flash" and "boot" memories in description
Any help would be greatly appreciated.
Code
Program: SerialMaster
/*
SerialMaster
*/
void setup() {
Serial.begin(9600);
//wait for serial port to connect.
while(!Serial) { ; }
//printing data so I know the code works to this point
Serial.println("");
Serial.println("Master Starting");
Serial.println("New Code 8");
}
void loop() {
Serial.print(1); //send 1 to slave
delay(1000);
Serial.print(0); //send 0 to slave
delay(1000);
}
Program: SerialSlave
/*
SerialSlave
*/
char c = ' ';
byte LED = 2;
void setup() {
pinMode(LED, OUTPUT);
Serial.begin(9600);
//printing data so I know the code works to this point
Serial.println("");
Serial.println("Slave Starting");
Serial.println("Cycling to read serial data. Rev. 3");
}
void loop() {
if(Serial.available())
{
char c = Serial.read(); // read serial data
if (c=='0') {digitalWrite(LED, LOW); } // turn on LED if serial data received = 0
if (c=='1') {digitalWrite(LED, HIGH); } // turn off LED if serial data received = 1
Serial.println(c);
}
}