#include "thingProperties.h"
int led1 = 19;
int led2 = 18;
void setup() {
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
// 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);
setDebugMessageLevel(2);
ArduinoCloud.printDebugInfo();
}
void loop() {
ArduinoCloud.update();
// Your code here
val = random(0, 999);
}
void onSwLed1Change() {
// Add your code here to act upon SwLed1 change
if(sw_led1){
digitalWrite(led1, HIGH);
}else{
digitalWrite(led1, LOW);
}
}
void onSwLed2Change() {
// Add your code here to act upon SwLed2 change
if(sw_led2){
digitalWrite(led2, HIGH);
}else{
digitalWrite(led2, LOW);
}
}