I am having a weird problem with Nano 33 on 9V power supply module with LCD. In trying to debug, I stripped down /re-wrote to very basic code, but this happens any time I am using this setup.
If I upload code to Nano via IDE, everything works 100% perfect so I believe my circuit is fine. But if I upload exact same code via Cloud (only changing Cloud-specifics, variable setup etc) the LCD powers on, runs a second, then seems to reset and start over. So via IDE on the code below, I get 1, 2, 3... as expected. But on Cloud, I see 1, then it pauses a sec, LCD looks to reset, I see 1 again... repeat forever.
The code is below, but I must be missing something here?
Thoughts?
/*
Sketch generated by the Arduino IoT Cloud Thing "Untitled 2"
https://create.arduino.cc/cloud/things/884c164a-8299-4333-a1a8-353e052dfc57
Arduino IoT Cloud Variables description
The following variables are automatically generated and updated when changes are made to the Thing
int ctr;
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"
#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
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();
}
void loop() {
ArduinoCloud.update();
lcd.setCursor(0,0);
lcd.clear();
ctr++;
lcd.print(ctr);
delay(500);
}
/*
Since Ctr is READ_WRITE variable, onCtrChange() is
executed every time a new value is received from IoT Cloud.
*/
void onCtrChange() {
// Add your code here to act upon Ctr change
}