Garage ohne Statusübertrag

This commit is contained in:
2020-06-13 20:35:39 +02:00
parent cbef1cc2ff
commit cd57b9eda9
17 changed files with 5 additions and 22 deletions
Regular → Executable
View File
Binary file not shown.
Regular → Executable
View File
Regular → Executable
View File

Before

Width:  |  Height:  |  Size: 228 KiB

After

Width:  |  Height:  |  Size: 228 KiB

View File

Before

Width:  |  Height:  |  Size: 453 KiB

After

Width:  |  Height:  |  Size: 453 KiB

@@ -37,10 +37,6 @@ void setup() {
pinMode(remoteButton, INPUT);
pinMode(motorButton, INPUT);
// disable SD card if one in the slot
pinMode(4, OUTPUT);
digitalWrite(4, HIGH);
// Serial.println("Starting ethernet");
Ethernet.begin(mac, ip);
@@ -67,7 +63,6 @@ void loop() {
// an http request ends with a blank line
bool currentLineIsBlank = true;
byte trigger = 0;
int sensorValue = 0;
char uri[64];
byte idx = 0;
@@ -105,21 +100,21 @@ void loop() {
client.println();
if (uri[4] == '/' && uri[5] == 'r' && uri[6] == ' ') {
client.println("trigger remote");
trigger = 1;
triggerRemote();
}
else if (uri[4] == '/' && uri[5] == 'm' && uri[6] == ' ') {
client.println("trigger motor");
trigger = 2;
triggerMotor();
}
else if (uri[4] == '/' && uri[5] == 'a' && uri[6] == ' ') {
client.println("trigger all");
trigger = 3;
triggerAll();
}
else if (uri[4] == '/' && uri[5] == 'o' && uri[6] == ' ') {
// check if open
if (sensorValue > 512) {
client.println("closed, opening now");
trigger = 2;
triggerMotor();
}
else {
client.println("already open");
@@ -132,7 +127,7 @@ void loop() {
}
else {
client.println("open, closing now");
trigger = 2;
triggerMotor();
}
}
else if (uri[4] == '/' && uri[5] == 's' && uri[6] == ' ') {
@@ -167,18 +162,6 @@ void loop() {
// close the connection:
client.stop();
// Serial.println("client disconnected");
if (trigger == 1) {
triggerRemote();
}
else if (trigger == 2) {
triggerMotor();
}
else if (trigger == 3) {
triggerAll();
}
trigger = 0;
}
}
View File
View File

Before

Width:  |  Height:  |  Size: 356 KiB

After

Width:  |  Height:  |  Size: 356 KiB

Regular → Executable
View File
Regular → Executable
View File
View File
Regular → Executable
View File
Regular → Executable
View File