You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2N3905 transistor that should be the equivalent of 2N2222.
The installation works fine, but after the boot the fan is running and the temp is 33.6'C.
With python I try to understand the state of the fan object importing just the code needed.
from gpiozero import OutputDevice
GPIO_PIN = 17 # Which GPIO pin you're using to control the fan.
fan = OutputDevice(GPIO_PIN)
after that the fan is active, and fan.active() return 0 that should mean OFF.
After that I read the OutputDevice docs and find that you can set the initial state of the object OutputDevice. So I edit the line
from fan = OutputDevice(GPIO_PIN, [active_high=True, initial_value=False])
to fan = OutputDevice(GPIO_PIN, active_high=False, initial_value=False)
Hope this can help someone else
The text was updated successfully, but these errors were encountered:
Hi there,
Can you explain what the last line change that you made in the initial state of the object OutputDevice really does? I am a newbie here so need some explanation on this haha.
I'm using a
2N3905 transistor that should be the equivalent of 2N2222.
The installation works fine, but after the boot the fan is running and the temp is 33.6'C.
With python I try to understand the state of the fan object importing just the code needed.
after that the fan is active, and
fan.active()
return0
that should mean OFF.After that I read the OutputDevice docs and find that you can set the initial state of the object OutputDevice. So I edit the line
from
fan = OutputDevice(GPIO_PIN, [active_high=True, initial_value=False])
to
fan = OutputDevice(GPIO_PIN, active_high=False, initial_value=False)
Hope this can help someone else
The text was updated successfully, but these errors were encountered: