diff --git a/examples/Touch_and_unlock/Touch_and_unlock.ino b/examples/Touch_and_unlock/Touch_and_unlock.ino index c2572bc..9d6b51c 100644 --- a/examples/Touch_and_unlock/Touch_and_unlock.ino +++ b/examples/Touch_and_unlock/Touch_and_unlock.ino @@ -16,6 +16,7 @@ void sfmPinInt1() { void setup() { SFM.setPinInterrupt(sfmPinInt1); // must perform this step in setup() to attach the inner interrupt. Serial.begin(115200); // not affiliated with module, just print unlock result. + SFM.disable(); // low-power design, power-off device } uint8_t temp = 0; // used to get recognition return @@ -25,6 +26,8 @@ void loop() { if(SFM.isTouched() != lastTouchState) { // Make sure the action just performed once when touch state changes lastTouchState = SFM.isTouched(); if(SFM.isTouched()) { + SFM.enable(); // low-power design, power-on device + delay(200); SFM.setRingColor(SFM_RING_RED, SFM_RING_OFF); // Ring fade from red to black at default period (500ms), creating a breathe effect // Here we are going to start recognition, if unlocked, we will change the ring color to green and send a message temp = SFM.recognition_1vN(tempUid); @@ -35,6 +38,8 @@ void loop() { } else { SFM.setRingColor(SFM_RING_OFF); + delay(200); + SFM.disable(); // low-power design, power-off device } } } \ No newline at end of file