Hi there,
I'm using an MKR Wi-Fi 1010 board to collect data from a Myoware EMG sensor. I want all the data points collected and stored wirelessly, and I've been looking into Arduino IoT Cloud for this.
My current problem is with my current code, Arduino IoT Cloud only updates the dashboard with my data values every 4 seconds. This misses a lot of crucial data points that I would otherwise see in the Serial Plotter. It was suggested to me that I may be able to collect 5 seconds worth of data into a data packet of some sort (maybe an array) and send that all at once to the cloud.
Is Arduino IoT Cloud capable of receiving data in this way? If so, what modifications does my program need to make this happen?
/*
Sketch generated by the Arduino IoT Cloud Thing "Untitled"
https://create.arduino.cc/cloud/things/dff6e9e6-94e3-410f-a9d8-76628cadfed8
Arduino IoT Cloud Variables description
The following variables are automatically generated and updated when changes are made to the Thing
CloudElectricPotential emgsignal;
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 SENSOR_PIN A1
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();
// Your code here
// Read sensor value
emgsignal = analogRead(SENSOR_PIN);
// Print value to Serial Monitor (for comparison purposes)
Serial.println(emgsignal);
}