raspberrypilearning / parent-detector Goto Github PK
View Code? Open in Web Editor NEWHow to use a Raspberry Pi to detect who's been in your room
Home Page: http://www.raspberrypi.org/learning/parent-detector/
License: Other
How to use a Raspberry Pi to detect who's been in your room
Home Page: http://www.raspberrypi.org/learning/parent-detector/
License: Other
In the code sample on worksheet.md, the sensor
variable is used before it's initialized with the value 4:
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(sensor, GPIO.IN, GPIO.PUD_DOWN)
sensor = 4
As reported via Twitter: https://twitter.com/robertabrandao/status/560578371244265475
There is an issue with Test the PIR sensor in locale: en. Error: Markdown contained an unclosed tag: ["hints"]
from http://www.raspberrypi.org/forums/viewtopic.php?f=79&t=78503
The code samples displayed at http://www.raspberrypi.org/learning/parent-detector/ do not have 'shebang' lines to invoke the python interpreter. Thus trying to run the code via ./pirtest.py as documented results in the script being passed to the shell, which fails.
(I note that the code stored on github does have these prefix lines, so this might be a more general formatting error?)
/learning expected a child project named mu-opening with content in en.
There is an issue with Test the PIR sensor in locale: en. Error: Markdown contained an unclosed tag: ["hints"]
Similarly to raspberrypilearning/gpio-music-box#8 the long header "Program the camera to preview on movement" in worksheet.md gets truncated to "PROGRAM THE CAMERA TO PREVIEW ON" when viewed on http://www.raspberrypi.org/learning/parent-detector/worksheet/
Perhaps the process that converts github-resources into website-resources could be modified to automatically warn you when a header is too long?
Expected a child project named camera-bullseye with content in en.
I do not wish to be pedantic but some of the terminology used in this worksheet is incorrect:
The OUT / output of the sensor is refers to a "sensor pin" rather than the "output of the sensor" or "Sensor Output"
More importantly still, the worksheet states that "This sensor pin will receive power whenever motion is detected by the PIR module." This is misleading on several counts. This pin is an output so it doesn't receive anything. The word power is also wrong. This pin outputs a voltage representing logic level 1 to signal that motion has been detected.
http://www.raspberrypi.org/learning/parent-detector/requirements/ says you only need "2 x Female-to-female jumper leads", but in the actual worksheet 3 jumper cables are used.
Hello all,
i'm trying to set up the parent detector without the camera but only writing down the time. Everytime motion is detected I write the current time to the console using datetime. But when there is motion it prints it like 20 times from 1 motion. When using time.sleep(1) it reduces it to 4 times writing it to the console. When using time.sleep(5) I got 1 log to the console but it's not able to write it every 5 seconds, it does it every 15 or so. So my question is, how can I get a accurate motion detection without printing multiple logs for a movement that happend in 1 second. My current code looks like this :
import datetime
from gpiozero import MotionSensor
pir = MotionSensor(4)
while True:
if pir.motion_detected:
print(datetime.datetime.now())
print("Motion detected!")
time.sleep(x) # high value for x = lower message per simple movement = 3*x time before it can detect new movement.
thanks!
pirtest code all on one line
"URL: /en/projects/parent-detector/7 tried following the parent-detector.py script, and it spends too much time teaching how to do individual things, but gives no indication how to implement them into the code and doesn't give the full final code at the end to see how it should look."
Should we include a link to the completed project?
There is an issue with Test the PIR sensor in locale: en. Error: Markdown contained an unclosed tag: ["hints"]
On http://www.raspberrypi.org/learning/parent-detector/ because the page has been formatted as fixed-width, the code print "GPIO pin {0} is {1}".format(sensorPin, "HIGH" if currState else "LOW")
has actually been split over two lines:
print "GPIO pin {0} is {1}".format(sensorPin, "HIGH"
if currState else "LOW")
which makes it look like the final if
is outside of the while
loop.
It could be simply rewritten as:
if currState:
newstate = "HIGH"
else
newstate = "LOW"
print "GPIO pin {0} is {1}".format(sensorPin, newstate)
but it looks as if even that might word-wrap? :-/
When LinuxFormat magazine includes code in their tutorials, they use a solid background colour to indicate code that should all be on one line when typed out, and whitespace between lines of code that should be on separate lines when typed out. Dunno if or how you'd do something like that in Markdown though - maybe a bit of clever CSS styling when you convert it to HTML?
There is an issue with Test the PIR sensor in locale: en. Error: Markdown contained an unclosed tag: ["hints"]
There is an issue with Test the PIR sensor in locale: en. Error: Markdown contained an unclosed tag: ["hints"]
There is an issue with Set up the camera preview in locale: en. Error: Markdown contained an unclosed tag: ["code"]
There is an issue with Test the PIR sensor in locale: en. Error: Markdown contained an unclosed tag: ["hints"]
Lots of teachers find this resource at Picademy and end up copying out the RPi.GPIO code. It would be much simpler with GPIO Zero :)
Also see #8 Update to use IDLE rather than nano.
Hi,
Does this work with pi 1!!!?
There is an issue with Test the PIR sensor in locale: en. Error: Markdown contained an unclosed tag: ["hints"]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.