Py Examples - Infineon/radar-bgt60 GitHub Wiki
The following examples show how to use the Python wrapper of the radar-bgt60 library with the BGT60LTR11AIP shield together with the Raspberry Pi.
Note:- Before running the examples the Raspberry Pi needs to be ready with the library installed and the repository cloned as described here.
:information_source: Note
Please open the example source files at src/framework/raspberrypi/examples_py/*.py
and read the comments before compiling it.
motionDetection
Description
This example shows how to check for motion with the radar sensor. For this we use the simple getMotion()
function continuously in the loop to check if a motion was detected or not.
Hardware Setup
In order to setup the hardware correctly check the following section.
Compile
:information_source: Please open the example source file at src/framework/raspberrypi/examples_py/motionDetection.py
and read the comments first before compiling it. :information_source:
Change to the Python examples folder:
cd src/framework/raspberrypi/examples_py
Now you can simply run the example code:
python3 motionDetection.py
directionDetection
Description
This example shows how to determine the direction of the detected motion in front of the radar sensor. It uses the getDirection()
function of the library and is calling it continuously in the loop to check the direction of the detected motion.
Hardware Setup
In order to setup the hardware correctly check the following section.
Compile
:information_source: Please open the example source file at src/framework/raspberrypi/examples_py/directionDetection.py
and read the comments first before compiling it. :information_source:
Change to the Python examples folder:
cd src/framework/raspberrypi/examples_py
Now you can simply run the code:
python3 directionDetection.py
interruptMode
This example shows you how to use the interrupt functionality of the library. Here, you can pass a user defined callback function to the class, which can then be used to check for motion and the direction of the motion.
Hardware Setup
In order to setup the hardware correctly check the following section.
Compile
:information_source: Please open the example source file at src/framework/raspberrypi/examples_py/interruptMode.py
and read the comments first before compiling it. :information_source:
Change to the Python examples folder:
cd src/framework/raspberrypi/examples_py
Now you can simply run the code:
python3 interruptMode.py