Teensy 4.1 - Arduino nano ESP32 Comunication

Luca

Active member
Hy, i've setted an arduino nano ESP 32 to comunicate with an arduino cloud dashboard to send a message over serial to a teensy, but the teensy doesn't seam to receive it.

Here's the arduino nano ESP 32 code:
Code:
#include "thingProperties.h"

int comando = 0;

void setup() {
  // Initialize serial and wait for port to open:
  Serial.begin(9600);
  Serial0.begin(9600);

  pinMode(13, OUTPUT);
  digitalWrite(13, HIGH);

  // Defined in thingProperties.h
  initProperties();

  // Connect to Arduino IoT Cloud
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);

  /*
     The following function allows you to obtain more information
     related to the state of network and IoT Cloud connection and errors
     the higher number the more granular information you’ll get.
     The default is 0 (only errors).
     Maximum is 4
  */
  setDebugMessageLevel(4);
  ArduinoCloud.printDebugInfo();
}

void loop() {
  ArduinoCloud.update();
  // Your code here

  if (led == HIGH) {
    digitalWrite(13, HIGH);
  } else digitalWrite(13, LOW);

  if(Serial0.available()){
    Serial.write(Serial0.read());
  }

}

void onLedChange()  {
    Serial0.write(comando);
    comando++;
}

Here's the teensy 4.1 code:
Code:
void setup() {
  Serial.begin(9600);
  Serial7.begin(9600);
}

void loop() {
  if(Serial7.available()){
    Serial.print(Serial7.read());
  }
}

Here's also an immage of the breadboard connections
IMG_4834 (2).jpg
 
Back
Top