20 lines
662 B
Python
20 lines
662 B
Python
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
|
|
|