walterwoj
Posts: 28
Joined: Fri Mar 15, 2019 10:46 pm

GPIO Floating Flimflamery

Mon Jul 22, 2019 2:07 am

I have previously posted here and here and here about my plans for using my pi to control my garage. I have got all the control components hooked up the way they should be but have not gotten any of the external components wired in. Now that everything is connected and mounted in the case I am doing some checks on the components to ensure they work the way I want. So far everything does what I want but there is some thing going on that I don't get:

I have an 8 channel relay board that will someday control stuff. Right now when the pi boots up all the lights on the board come on weakly indicating low voltage but not enough to trip the board (floating? ) Now I know that the GPIO are all set to input, so I did

Code: Select all

gpio mode 22 output 
and the relay kicks on because the pin went low (0) and the light powers brightly. Then I do

Code: Select all

gpio write mode 1
and the relay kicks off and light goes out. I realize this was a long explanation but here's my question:

How can I set them to start out in one state or another at boot (or before)? (some things don't like conflicting inputs any more than the PI does and powering on then off could cause the things I'm controlling to power cycle and do weird things like open my garage door every time the pi boots, funny but undesirable! :lol: )


walterwoj
Posts: 28
Joined: Fri Mar 15, 2019 10:46 pm

Re: GPIO Floating Flimflamery

Mon Jul 22, 2019 11:22 am

Perfect! Thanks! :D

Return to “Beginners”