30 lines
1.1 KiB
C
30 lines
1.1 KiB
C
// Code generated by Arduino IoT Cloud, DO NOT EDIT.
|
|
|
|
#include <ArduinoIoTCloud.h>
|
|
#include <Arduino_ConnectionHandler.h>
|
|
|
|
const char DEVICE_LOGIN_NAME[] = "";
|
|
const char SSID[] = ""; // Network SSID (name)
|
|
const char PASS[] = ""; // Network password (use for WPA, or use as key for WEP)
|
|
const char DEVICE_KEY[] = ""; // Secret device password
|
|
|
|
void onWaterNowChange();
|
|
|
|
CloudTemperatureSensor temperature;
|
|
CloudRelativeHumidity humidity;
|
|
CloudRelativeHumidity soil_humidity;
|
|
bool is_raining;
|
|
bool water_now;
|
|
|
|
void initProperties(){
|
|
|
|
ArduinoCloud.setBoardId(DEVICE_LOGIN_NAME);
|
|
ArduinoCloud.setSecretDeviceKey(DEVICE_KEY);
|
|
ArduinoCloud.addProperty(water_now, READWRITE, ON_CHANGE, onWaterNowChange);
|
|
ArduinoCloud.addProperty(temperature, READ, 10 * SECONDS, NULL);
|
|
ArduinoCloud.addProperty(humidity, READ, 10 * SECONDS, NULL);
|
|
ArduinoCloud.addProperty(soil_humidity, READ, 10 * SECONDS, NULL);
|
|
ArduinoCloud.addProperty(is_raining, READ, 10 * SECONDS, NULL);
|
|
}
|
|
|
|
WiFiConnectionHandler ArduinoIoTPreferredConnection(SSID, PASS); |