Fetch the current position of the blind every 10 seconds
This commit is contained in:
@@ -33,6 +33,8 @@ void sendStopPacket(uint16_t destination);
|
|||||||
void sendSetPosition(uint16_t destination, float percentage);
|
void sendSetPosition(uint16_t destination, float percentage);
|
||||||
void sendFetchPosition(uint16_t destination);
|
void sendFetchPosition(uint16_t destination);
|
||||||
|
|
||||||
|
unsigned long lastCommandMillis = 0;
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(SER_BAUDRATE);
|
Serial.begin(SER_BAUDRATE);
|
||||||
|
|
||||||
@@ -49,12 +51,18 @@ void setup() {
|
|||||||
client.enableDebuggingMessages();
|
client.enableDebuggingMessages();
|
||||||
|
|
||||||
delay(100);
|
delay(100);
|
||||||
|
lastCommandMillis = millis();
|
||||||
Serial.println("Ready");
|
Serial.println("Ready");
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
powerView.loop();
|
powerView.loop();
|
||||||
client.loop();
|
client.loop();
|
||||||
|
|
||||||
|
if ((millis() - lastCommandMillis) > 10000) {
|
||||||
|
lastCommandMillis = millis();
|
||||||
|
sendFetchPosition(0x4EF1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void processPacket(const Packet *packet) {
|
void processPacket(const Packet *packet) {
|
||||||
|
|||||||
Reference in New Issue
Block a user