-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgarage.ino
69 lines (48 loc) · 1.34 KB
/
garage.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
#include "SoulissFramework.h"
#include "bconf/StandardArduino.h"
#include "conf/ethW5100.h"
#include <SPI.h>
/*** All configuration includes should be above this line ***/
#include "Souliss.h"
//define IP network config
uint8_t ip_address[4] = {192, 168, 1, 79};
uint8_t subnet_mask[4] = {255, 255, 255, 0};
uint8_t ip_gateway[4] = {192, 168, 1, 1};
#define myvNet_address ip_address[3]
#define myvNet_gateway 77
#define myvNet_subnet 0xFF00
// Local light slot
#define SL_GARAGELIGHT 0
// Local Light output PIN
#define GARAGE 7
// Local button input PIN
#define B_GARAGE 5
void setup() {
Initialize();
SetIPAddress(ip_address, subnet_mask, ip_gateway);
SetAddress(myvNet_address, myvNet_subnet, myvNet_gateway);
SetAsGateway(myvNet_gateway);
pinMode(GARAGE, OUTPUT);
pinMode(B_GARAGE, INPUT);
// Define light logic
Set_T11(SL_GARAGELIGHT);
}
void loop() {
EXECUTEFAST() {
UPDATEFAST();
FAST_50ms() {
Logic_T11(SL_GARAGELIGHT);
if(DigIn(B_GARAGE, Souliss_T1n_ToggleCmd, SL_GARAGELIGHT))
{
DigOut(GARAGE, Souliss_T1n_Coil, SL_GARAGELIGHT);
}
}
FAST_BridgeComms();
}
EXECUTESLOW() {
UPDATESLOW();
SLOW_10s() { // Process the timer every 10 seconds
Timer_SimpleLight(SL_GARAGELIGHT);
}
}
}