-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathepal-iotkit.ino
90 lines (65 loc) · 2.06 KB
/
epal-iotkit.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include "arduino_secrets.h"
/*
Sketch generated by the Arduino IoT Cloud Thing "EIoTK_Activity_02"
https://create.arduino.cc/cloud/things/eeb745e3-8a83-499b-94f5-b198740e4199
Arduino IoT Cloud Properties description
The following variables are automatically generated and updated when changes are made to the Thing
float humidity;
float temperature;
CloudPressure pSI;
Properties 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"
#include <Arduino_MKRIoTCarrier.h>
MKRIoTCarrier carrier;
void setup() {
// Initialize serial
Serial.begin(9600);
// Defined in thingProperties.h
initProperties();
// Connect to Arduino IoT Cloud
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
CARRIER_CASE = true;
carrier.begin();
//Get Cloud Info/errors , 0 (only errors) up to 4
setDebugMessageLevel(4);
ArduinoCloud.printDebugInfo();
while (ArduinoCloud.connected() != 1) {
ArduinoCloud.update();
carrier.display.setTextSize(5);
carrier.Pressure.readPressure();
carrier.display.setCursor(20, 70);
carrier.display.println("epal");
carrier.display.setCursor(5, 110);
carrier.display.println("kastoria");
delay(500);
}
}
void loop() {
ArduinoCloud.update();
// Your code here
}
temperature = carrier.Env.readTemperature();
humidity = carrier.Env.readHumidity();
Serial.print(temperature);
Serial.print(",");
Serial.println(humidity);
Serial.print(coloredlight)
delay(1000);
}
/*
Since PSI is READ_WRITE variable, onPSIChange() is
executed every time a new value is received from IoT Cloud.
*/
void onPSIChange() {
// Add your code here to act upon PSI change
}
/*
Since Coloredlight is READ_WRITE variable, onColoredlightChange() is
executed every time a new value is received from IoT Cloud.
*/
void onColoredlightChange() {
// Add your code here to act upon Coloredlight change
}