-
Notifications
You must be signed in to change notification settings - Fork 0
/
CavyIoTdevelopmentBoard.INO
37 lines (33 loc) · 1.28 KB
/
CavyIoTdevelopmentBoard.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
#include "CavyIoTdevelopmentBoard.h"
CavyIoT myIoTdevice;
long t, h, s, p;
int rx = 10;
int tx = 11;
int rst = 13;
void setup()
{
Serial.begin(9600);
myIoTdevice.SetPort(rx, tx, rst);
Serial.println("Setting device buttons!.");
myIoTdevice.DefineButtonLables("heater", "on", "off",
"motor", "on", "off",
"bulb", "on", " off",
"fan", "on", "off");
Serial.println("Wait for a while to connect!.");
myIoTdevice.StartDevice("WifiSSID", "WiFipassword", /*CavyIoT--->*/ "Username", "password", "device");
}
void loop()
{
Serial.println("Device Status:-" + myIoTdevice.Status); // Prints the current status of Buttons & working mode of device on Remote Control Panel.
// https://developers.cavyiot.com/cpanel.php
myIoTdevice.loop(); // Updates the Status variable.
t = random(39, 42);
h = random(22, 44);
s = random(5, 12);
p = random(40, 44);
myIoTdevice.UpdateSensorData("Temperature", String(t), "C",
"humidity", String(h), "Rh",
"Speed", String(s), "km/hr",
"pressure", String(p), "Psi"
);
}