Hi!
I’ve read in many posts that the Arduino Cloud Editor doesn’t work properly with ESP32 boards. Instead, it’s recommended to use the Arduino IDE for sketching, uploading, and using the Serial Monitor. Here’s my code:
#include "arduino_secrets.h"
/*
Sketch generated by the Arduino IoT Cloud Thing "Untitled"
https://create.arduino.cc/cloud/things/540228a6-b349-4a44-871f-9510a43543f9
Arduino IoT Cloud Variables description
The following variables are automatically generated and updated when changes are made to the Thing
float x;
Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
which are called when their values are changed from the Dashboard.
These functions are generated with the Thing and added at the end of this sketch.
*/
#include "thingProperties.h"
void setup() {
// Initialize serial and wait for port to open:
Serial.begin(9600);
// This delay gives the chance to wait for a Serial Monitor without blocking if none is found
delay(1500);
// 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(2);
ArduinoCloud.printDebugInfo();
}
float step = 0.1; // Tamaño del incremento
bool increasing = true; // Dirección del cambio
void loop() {
ArduinoCloud.update();
// Modificar el valor de x entre 0 y 10
if (increasing) {
x += step; // Incrementar x
if (x >= 20) {
increasing = false; // Cambiar dirección al llegar a 10
}
} else {
x -= step; // Decrementar x
if (x <= 0) {
increasing = true; // Cambiar dirección al llegar a 0
}
}
// Enviar el valor actualizado a la nube
delay(0); // Controlar la velocidad de cambio
Serial.println("Hi world");
}
The problem is that when I open the Serial Monitor at 9600 Hz, nothing is displayed. Additionally, no connection information appears, such as the IP address or any details I’ve seen in many tutorial videos.