pimoroni / automation-hat

Python library and examples for the Pimoroni Automation HAT, pHAT and HAT Mini
https://shop.pimoroni.com/products/automation-hat
MIT License
122 stars 41 forks source link

Set default pin states for relays #15

Closed Gadgetoid closed 6 years ago

Gadgetoid commented 6 years ago

See: https://forums.pimoroni.com/t/automation-hat-node-red-nodes/6640/2

ronnyvdbr commented 6 years ago

I was able to resolve the problem. The problem lies within your init library, where you initialise the gpio pins for the relays. There seems to be a missing parameter on line 188:

GPIO.setup(self.pin, GPIO.OUT, initial=0)

the initial=0 parameter was missing which determines the startup state of the pins which controls the relays.

https://github.com/pimoroni/automation-hat/blob/master/library/automationhat/init.py

Gadgetoid commented 6 years ago

Was fixed in 90b45b56e641e9fb19e6c1381380e71ce99ad04c