Go to advanced search

by Marre
Sat Mar 12, 2016 9:59 pm
Forum: HATs and other add-ons
Topic: How to sense a 5v input with GPIO
Replies: 18
Views: 49686

Re: How to sense a 5v input with GPIO

Just bought a PIR and saw this post. Seems like no need to limit the voltage as the "standard" raspberry PIR specs. read ".... Output: Digital pulse high (3V) when triggered (motion detected) digital low when idle (no motion detected)." Input is 5-12V. Should be fine with just current limiting resis...
by Marre
Sat Jan 23, 2016 6:10 pm
Forum: Python
Topic: Stopwatch
Replies: 34
Views: 14030

Re: Stopwatch

Due to the fact that I'm running the screen on my PC with TightVNC client, I learnt some other things today: - There is a lot of "hissing" going on over the 3.5mm audio output. To handle this during the race, I've added stopped the sound (pygame.mixer.stop()) and reinitialized it for each run. The H...
by Marre
Thu Jan 21, 2016 9:39 pm
Forum: Python
Topic: Stopwatch
Replies: 34
Views: 14030

Re: Stopwatch

Good thing it's noted. I forgot to mention I solved it using: GPIO.remove_event_detect(pin/channel), which clears it each rerun of the program, so no problem in my program with that. So I didn't really have the problem with triggering on up+down, rather the add events kept stacking up, so run 1 was ...
by Marre
Mon Jan 18, 2016 9:33 pm
Forum: Python
Topic: Multiple GPIO.add_event_detect, one callback function
Replies: 18
Views: 37868

Re: Multiple GPIO.add_event_detect, one callback function

I was having problems with this in a program which the user could rerun. Although using GPIO.cleanup() as part of a try/except/finally block under the while loop, it did not remove GPIO.add_event_detect, which was causing trouble with multiple simultanious events during reruns of the program. It was...
by Marre
Mon Jan 18, 2016 9:29 pm
Forum: Python
Topic: Stopwatch
Replies: 34
Views: 14030

Re: Stopwatch

As promised, I've now managed to learn some basic Pygame and updated the Race timer accordingly. You can also run another race without exiting the program. Fonts, images and sounds can be downloaded from enywhere. A couple of lessons learned: 1. GPIO.cleanup() did not remove GPIO.add_event_detect, w...
by Marre
Thu Dec 31, 2015 11:22 am
Forum: Python
Topic: Stopwatch
Replies: 34
Views: 14030

Re: Stopwatch

Hi all, I put a litte stop watch, race timer together using my Pi 2, IR-LEDs and Python. It's not pretty and I'm going to add some Pygame graphics later on (any help here highly appreciated), but it's working :) It handles 2 lanes, best lap time for each track (please note you need to create the emp...

Go to advanced search