initial setup for relay board

This commit is contained in:
0xEmm 2024-01-16 19:35:00 +01:00
parent 7227decc36
commit c5a677e574

View file

@ -1,2 +1,20 @@
import gpiozero as GPIO import gpiozero as GPIO
from gpiozero.pins.mock import MockFactory
GPIO.Device.pin_factory = MockFactory()
# ONLY HERE FOR RUNNING ON NON RPI DEVICES
pinIDs = {
'minus_up_A': 11, 'operating_up_A': 13, 'service_up_A': 15,
'minus_down_A': 12, 'operating_down_A': 16, 'service_down_A': 18,
'minus_up_B': 33, 'operating_up_B': 35, 'service_up_B': 37,
'minus_down_B': 36, 'operating_down_B': 38, 'service_down_B': 40
}
# selected pins to best fit position and usage
pins = {k: GPIO.LED(v) for k, v in pinIDs.items()}
# LED is default pin output operation
# operating switch one time press - finishes cycle
# service switch hold - manual movement