Hi,
I suspect I'm missing something really obvious here so I'll appreciate a nudge in the right direction please!
I'm using a MKR1010 and have no issues at all sending and receiving bool and int type values to and from the device and web dashboard... but floats seem to be a no go! Whether defined in the dashboard as a float, or a percentage or a temperate.
In the below, the int and the bool return data fine, but nothing from the floats. What am I missing please?
Thanks in advance,
-- Chirs
thingproperties.h snipped
void onAmbientHumidityChange();
float ambientTemperature;
int inttest;
bool boolTest;
float ambientHumidity;
void initProperties(){
ArduinoCloud.setThingId(THING_ID);
ArduinoCloud.addProperty(ambientTemperature, READ, ON_CHANGE, NULL);
ArduinoCloud.addProperty(inttest, READ, ON_CHANGE, NULL);
ArduinoCloud.addProperty(boolTest, READ, ON_CHANGE, NULL);
ArduinoCloud.addProperty(ambientHumidity, READWRITE, ON_CHANGE, onAmbientHumidityChange);
}
ConnectionManager *ArduinoIoTPreferredConnection = new WiFiConnectionManager(SSID, PASS);
.ino snippet
#include "thingProperties.h"
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();
//initialise variables
boolTest = true;
inttest = 0;
ambientTemperature = 15;
ambientHumidity = 50;
}
void loop() {
ArduinoCloud.update();
// Your code here
delay(2000);
boolTest = !boolTest;
inttest++;
Serial.println(ambientTemperature);
}