I am trying to control an LED using a switch. I am sharing internet from my cellphone and also the internet that I have at home. It worked properly one week ago, but now it is not working any more, I have already checked my Internet, the device and many other things, but it isn´t working, could you please help me? ![]()
Hi! We need some more info to help.
I guess you already restarted the board.
If you connected the baord via USB to the PC, which logs do you see printed on the serial monitor output? You can see them going to cloud editor > 'Serial Monitor' .
Did you used a your own sketch or a template? Can you share the code?
Thanks
Hi macolomb ![]()
I really appreciate very much your help !!!
When I open the serial monitor it appears nothing
all blank, and my Arduino Uno R4 Wifi is already connected, I am using a usb - c wire.
I used the sketch that is produced automatically by Arduino Cloud, I just typed few lines to make an LED to light up and turn off using a switch ![]()
2 weeks ago it was working, but I do not know why it is not working now.
I am sharing you my code:
/*
Sketch generated by the Arduino IoT Cloud Thing "Untitled"
https://create.arduino.cc/cloud/things/d59805c0-4af4-4ade-af6b-841d0cc53379
Arduino IoT Cloud Variables description
The following variables are automatically generated and updated when changes are made to the Thing
bool lED;
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"
#define LEDpin 2
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);
pinMode(LEDpin, OUTPUT);
// 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();
}
void loop() {
ArduinoCloud.update();
// Your code here
if(lED == 1){
digitalWrite(LEDpin, 1);
}else{
digitalWrite(LEDpin, 0);
}
}
/*
Since LED is READ_WRITE variable, onLEDChange() is
executed every time a new value is received from IoT Cloud.
*/
void onLEDChange() {
// Add your code here to act upon LED change
}
Hi macolomb ![]()
I just wanted to let you know that I already soved the problem ![]()
In case that it could help someone else, I deleted the device from my Arduino Cloud account and then I configure it again, after that everything worked correctly !!!
Thanks a lot for being so kind ![]()