topguy wrote: ↑Mon Mar 05, 2018 1:21 pm
Ask specific questions, be detailed about what you have done/tested so far.
Did you manage to follow the instructions from the guided example and get the same results ?
Do you understand how/why the example works?
t I don't really understand how I can activate this device.
The sensor doesnt really need to be "activated" or turned on, it just need power and then it will report back detected motion by the digital IO pin.
But if you mean "activated" as "triggered" then it should react to you waving a hand over it.
Thank you very much for your explanation. I tried to follow the instruction as good as I can but I stumbled upon a problem. I wired the PIR like the instruction shows but when I put the code in python 3 I got an error.
Code: Select all
Traceback (most recent call last):
File "/home/pi/Desktop/motion detector.py", line 1, in <module>
from gpiozero import MotionSensor
File "/usr/lib/python3/dist-packages/gpiozero/__init__.py", line 58, in <module>
from .devices import (
File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 18, in <module>
import pkg_resources
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1129, in _exec
File "<frozen importlib._bootstrap>", line 1467, in exec_module
File "<frozen importlib._bootstrap>", line 1570, in get_code
File "<frozen importlib._bootstrap>", line 656, in _compile_bytecode
ValueError: bad marshal data (invalid reference)
>>>
what can I do to prevent this error?