How to use the accelerometer and tap detect for perimeter security


Apologies for a newbie question. I have installed and configured my first Zymkey 4i on a Raspberry Pi 5 running Debian Bookworm (Raspberry Pi OS). The Zymkey is up and connected and I have installed the python and C libraries and I am getting accelerometer data. When I change the orientation of the pi or move it fast, the (x,y,z) numbers change. Questions:

  1. What does “tap” means"? Tapping what? Tap the zymkey, tap the pi, or does it mean something all different? I am asking this because I have tried different things, and I cannot make the tap value to change to anything but “0”.

  2. I’d like to be able to detect and alert on anyone moving the raspberry pi even slightly. How would I do this with the combination of zkWaitForTap, zkSetTapSensitivity, zkGetAccelerometerData and/or any of the other perimeter functions?

Thank you.

@beh tapping means physically tapping the Zymkey or Pi. You can use the APIs to increase the sensitivity to see a tap event. Try setting to 100, then back it down to something that works for you.

Thank you. That worked.