Good morning,
I'm working with an Arduino MKR 1010. I uploaded a simple sketch that I attach below: it is just a code to controll through the IoT Cloud a relay connected to a waterpump for a future Smart Garden project. My question is: I connected the Arduino for all night with a USB to a socket and the morning after I saw that the charged LED blinked at 1Hz.
I saw in the manual (https://support.arduino.cc/hc/en-us/articles/360016119199-What-is-the-meaning-of-CHRG-LED-different-states-in-MKR-boards-) that could be related to a "Charge suspend" issue and in particular due to several reasons:
- Input over-voltage
- TS fault (temperature fault)
- Timer fault
- Input or system over-voltage
How can I debug this problem? Should I care about it or it is not important?
Thanks in advance.
Lorenzo
My code:
/*
Arduino IoT Cloud Variables description
The following variables are automatically generated and updated when changes are made to the Thing
String message;
String message_2;
bool pump_state;
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"
const int relay = A5;
void setup() {
Serial.begin(9600);
delay(1500);
// Defined in thingProperties.h
initProperties();
// Connect to Arduino IoT Cloud
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
setDebugMessageLevel(2);
ArduinoCloud.printDebugInfo();
pinMode(relay, OUTPUT);
digitalWrite(relay, HIGH);
}
void loop() {
ArduinoCloud.update();
Serial.print("Pump state:");
Serial.println(pump_state);
delay(1000);
}
/*
Since PumpState is READ_WRITE variable, onPumpStateChange() is
executed every time a new value is received from IoT Cloud.
*/
void onPumpStateChange() {
if (pump_state == false) {
digitalWrite(relay, HIGH);
message = "Pump OFF!";
}
else {
digitalWrite(relay, LOW);
message = "Pump ON!";
}
}