I already added both z-uno (with secutity S0) and digital door lock to RaZberry then associate z-uno to digital door lock show you in image below.
https://drive.google.com/open?id=1pvRVb ... Yk6DaHBk5B
https://drive.google.com/open?id=1xwA4c ... I7CkEN_GAn
Z-uno code I use this example will show in code below
Code: Select all
byte buttonUpPressed = 0; // Is button Up pressed
byte buttonDownPressed = 0; // Is button Down pressed
ZUNO_SETUP_ASSOCIATIONS(ZUNO_ASSOCIATION_GROUP_DOORLOCK); // Works only if Security is enabled in Z-Uno!
void setup() {
pinMode(19, INPUT_PULLUP); // Two buttons to send On and Off
pinMode(20, INPUT_PULLUP); // Use internal pull up on both
}
void loop() {
if (digitalRead(19) == LOW) { // Button Up is pressed
if (buttonUpPressed == 0) { // It was not pressed – press event detected
zunoSendToGroupDoorlockControl(CTRL_GROUP_1, 255); // Open the door
buttonUpPressed = 1; // Save the state not to send the command again
}
} else {
buttonUpPressed = 0; // Reset the state on release
}
if (digitalRead(20) == LOW) { // Button Down is pressed
if (buttonDownPressed == 0) { // It was not pressed – press event detected
zunoSendToGroupDoorlockControl(CTRL_GROUP_1, 0); // Close the door
buttonDownPressed = 1; // Save the state not to send the command again
}
} else {
buttonDownPressed = 0; // Reset the state on release
}
delay(10); // Check buttons state every 10 ms
}
Please advice.