//Device ID : 36f1a4f7-3ffa-42dd-886c-e61d075c667e
//Secret Key : 2vB1FoVOVmkMqZ7CLlCaWOAyX
/*
Sketch generated by the Arduino IoT Cloud Thing "Untitled"
https://create.arduino.cc/cloud/things/3d9d2178-346f-442b-81d4-f969b4958654
Arduino IoT Cloud Variables description
The following variables are automatically generated and updated when changes are made to the Thing
bool LEVEL1;
bool LEVEL2;
bool LEVEL3;
bool SIREN;
bool SOS;
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 level1 15
#define level2 4
#define level3 17
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);
pinMode(level1, OUTPUT);
pinMode(level2, OUTPUT);
pinMode(level3, OUTPUT);
// 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
}
/*
Since LEVEL1 is READ_WRITE variable, onLEVEL1Change() is
executed every time a new value is received from IoT Cloud.
*/
void onLEVEL1Change() {
if( LEVEL1 == true){
digitalWrite(level1, HIGH);
}else{
digitalWrite(level1, LOW);
}
}
/*
Since LEVEL2 is READ_WRITE variable, onLEVEL2Change() is
executed every time a new value is received from IoT Cloud.
*/
void onLEVEL2Change() {
// Add your code here to act upon LEVEL2 change
}
/*
Since LEVEL3 is READ_WRITE variable, onLEVEL3Change() is
executed every time a new value is received from IoT Cloud.
*/
void onLEVEL3Change() {
// Add your code here to act upon LEVEL3 change
}
/*
Since SIREN is READ_WRITE variable, onSIRENChange() is
executed every time a new value is received from IoT Cloud.
*/
void onSIRENChange() {
// Add your code here to act upon SIREN change
}
/*
Since SOS is READ_WRITE variable, onSOSChange() is
executed every time a new value is received from IoT Cloud.
*/
void onSOSChange() {
// Add your code here to act upon SOS change
}