Jun-05-2024, 12:44 PM
Quote:Hey everyone
so I have this simple function for my raspberry pi
and I made a python file it does work
from gpiozero import LED from gpiozero.pins.pigpio import PiGPIOFactory # this IEP address is assigned to raspberry pi factory = PiGPIOFactory(host='pi's IP address') Switch_1 = LED(18, pin_factory=factory) Switch_2 = LED(23, pin_factory=factory) Switch_3 = LED(24, pin_factory=factory) Switch_1.on() Switch_2.on() Switch_3.on()But the problem I'm running into
I tried to merge it into another python file
and put it under a function which I called
def raspberry_pi():
but for whatever reason it doesn't work I'm having a hard time understanding why
Under that function I can call the file and it will work
I just can't put everything under the function I don't understand what's going on
Has anyone ran into this problem