Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fan start on boot #3

Open
gchecchin92 opened this issue Apr 6, 2020 · 1 comment
Open

Fan start on boot #3

gchecchin92 opened this issue Apr 6, 2020 · 1 comment

Comments

@gchecchin92
Copy link

gchecchin92 commented Apr 6, 2020

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.

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

@bilalh96
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants