Your LED might be turning off when the end of the script is reached, for example the following script will turn the LED on for 5 seconds, then end, and restore the pin back to its original state (LED off):
from gpiozero import LED
from time import sleep
led = LED(5)
In order to keep the LED on indefinitely, the script must be kept alive. ...
Agustina, my classmate, pointed out the mistake.
started = False
seconds = 0
belowLow = 0
self.listen() <-- should not be included
Because of self.listen() it was recursing. I hope I am using the correct term.
No. Do not install it in /usr/bin. /usr/bin is for programs installed by the package manager. If you install packages manually, they go in /usr/local/bin (or ~/.local/bin etc.).
You can use the --prefix option of the configure script to select the folder to install it to, by default the prefix is /usr/local. As mentioned in (1), don't set it to /usr or you'...
Rather than the rather bizarre steps you followed, most of which are unnecessary and possibly damaging I suggest you restore a clean Ubuntu and utilise the included Python.
Then download the official tarball https://pypi.org/project/RPi.GPIO/#files
Then follow the instructions included, viz.
$ sudo apt-get install python-dev python3-dev
To install the ...
You can use simple timers to have full control about the time and switches. Just create a service that will switch the lights and create two timer, one to switch on and one to switch off the lights. First create the service:
rpi ~$ sudo systemctl edit --force --full switch-lights@.service
In the empty editor insert these statements, save them and quit the ...
I like simple. This is how I'd do it:
In your editor, add the following lines to your crontab:
@reboot /bin/sleep 30; /usr/bin/gpio -g mode 17 out
0 18 * * * /usr/bin/gpio -g write 17 1
0 1 * * * /usr/bin/gpio -g write 17 0
Save your crontab, and exit the editor. At 6:00 PM (your RPi time), GPIO 17 (pin 11) will go "HIGH"; i.e. the ...