Motion click by Mikro Elektronika


#1

Hi!
I’m working with Motion click, a motion detector sensitive produced by MirkoElektronika (assembled on flip and click).
I cannot find code examples of this module.
The producer provides some examples in C, Basic and Pascal (not in Python).

Can you give me an example of code for Zerynth?
I must to:
1) import its library
2) detect position (I suppose sensor give a binary value 1 or 0)

Thanks in advance!


#2

Hi gruppoe,

You have to turn on the PIR500B (pyroelectric sensor) putting to high logic level the device pin wired to “EN” pin on the motion click and then you can read the digital pin linked to its “OUT” pin (“INT” pin on mikroBUS slot) to detect live bodies.

# setup for motion click mounted on mikroBus slot A of a flip n click device

digitalWrite(D16,1) # to turn on the sensor

res = digitalRead(D21) # to detect live bodies

<br>Hope this can help you.