I am tying to measure voltage and store data on IoT cloud for a week, I have configure MRX1000 with my home wifi. It is running since yesterday but does not seems to be pushing data to cloud correctly,
I have two variables, Float and boolean, both configured to update every 0.1 sec. dashboard does not display continuous graph. It seems to be hanged. And it also does not record data either. I downloaded measurements after 4 hours run, but there was only 100 lines of mesurements.
#include "thingProperties.h"
void setup()
{
// Initialize serial and wait for port to open:
Serial.begin(9600);
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();
// Your code here
int sensorValue = analogRead(A0);
// Convert the analog reading (which goes from 0 - 1023) to a voltage (-1 - 0V):
float voltage = sensorValue * (-1 / 1023.0);
vacuum = voltage;
if (vacuum>-0.45) {vacuumStatus=false;}
if (vacuum<=-0.45) {vacuumStatus=true;}
}
void onVacuumChange() {
// Do something
}
This isn't the "wrong thread". The "Create > IoT Cloud Beta" forum board is exactly the right place to post this. I deleted your cross-post, which was not in the right place.