Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5169

Beginners • LED works when running from IDE, but not cronjob

$
0
0
I have the most simplest code ever for an LED to turn on. It runs fine from Thonny, but when it runs on a cronjob, it only faintly blinks, so fast you have to be staring at it to catch it happening. The code is called redon.py, and it is in /home/pi/ folder.

Code:

from gpiozero import LEDimport timered = LED(21)red.on()
My cronjob is */1 * * * * python3 /home/pi/redon.py
Nothing else is running on cronjobs. This is the only GPIO connected.

What could be causing this to not turn the LED on?

Statistics: Posted by duckredbeard — Mon Nov 11, 2024 11:42 am



Viewing all articles
Browse latest Browse all 5169

Trending Articles