Go to advanced search

by CyberGyver
Mon Oct 02, 2017 8:19 pm
Forum: Python
Topic: GPIOZero - 2 fonction for same GPIO ?
Replies: 17
Views: 3631

Re: GPIOZero - 2 fonction for same GPIO ?

I'm glad we could help. The python code is now on GitHub: https://github.com/CyberGyver/Raspberry ... eleased.py.
by CyberGyver
Sat Sep 30, 2017 2:14 am
Forum: Python
Topic: GPIOZero - 2 fonction for same GPIO ?
Replies: 17
Views: 3631

Re: GPIOZero - 2 fonction for same GPIO ?

The value of active_time is always "None" for me, but this code does the job: #!/usr/bin/env python3 from gpiozero import Button from signal import pause import time # Physical pin 40 = BCM pin 21. Button hold time 2 seconds. button = Button(21, hold_time=2) def pressed(): global press_time press_ti...

Go to advanced search