hello there,
I got an opla kit a little while ago so I used it today. all was going well when the dashboard stopped updating the values. I was using the personal weather station here is the code:`
#include "thingProperties.h"
#include <Arduino_MKRIoTCarrier.h>
MKRIoTCarrier carrier;
void setup() {
// Initialize serial and wait for port to open:
Serial.begin(9600);
while (!Serial);
// Defined in thingProperties.h
initProperties();
// Connect to Arduino IoT Cloud
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
//Get Cloud Info/errors , 0 (only errors) up to 4
setDebugMessageLevel(2);
ArduinoCloud.printDebugInfo();
//Wait to get cloud connection to init the carrier
while (ArduinoCloud.connected() != 1) {
ArduinoCloud.update();
delay(500);
}
delay(500);
CARRIER_CASE = false;
carrier.begin();
carrier.display.setRotation(0);
delay(1500);
}
void loop() {
ArduinoCloud.update();
carrier.Buttons.update();
while(!carrier.Light.colorAvailable()) {
delay(5);
}
int none;
carrier.Light.readColor(none, none, none, light);
temperature = carrier.Env.readTemperature();
humidity = carrier.Env.readHumidity();
pressure = carrier.Pressure.readPressure();
if (carrier.Button0.onTouchDown()) {
carrier.display.fillScreen(ST77XX_WHITE);
carrier.display.setTextColor(ST77XX_RED);
carrier.display.setTextSize(2);
carrier.display.setCursor(30, 110);
carrier.display.print("Temp: ");
carrier.display.print(temperature);
carrier.display.print(" C");
}
if (carrier.Button1.onTouchDown()) {
carrier.display.fillScreen(ST77XX_WHITE);
carrier.display.setTextColor(ST77XX_RED);
carrier.display.setTextSize(2);
carrier.display.setCursor(30, 110);
carrier.display.print("Humi: ");
carrier.display.print(humidity);
carrier.display.print(" %");
}
if (carrier.Button2.onTouchDown()) {
carrier.display.fillScreen(ST77XX_WHITE);
carrier.display.setTextColor(ST77XX_RED);
carrier.display.setTextSize(2);
carrier.display.setCursor(30, 110);
carrier.display.print("Light: ");
carrier.display.print(light);
}
if (carrier.Button3.onTouchDown()) {
carrier.display.fillScreen(ST77XX_WHITE);
carrier.display.setTextColor(ST77XX_RED);
carrier.display.setTextSize(2);
carrier.display.setCursor(30, 110);
carrier.display.print("Pressure: ");
carrier.display.print(pressure);
}
if (humidity >= 60 && temperature >= 15) {
weather_report = "It is very humid outside";
}else if (temperature >= 15 && light >= 700) {
weather_report = "Warm and sunny outside";
}else if (temperature <= 16 && light >= 700) {
weather_report = "A little cold, but sunny outside";
}
else{
weather_report = "Weather is normal";
}
}`