def __init__(self, devices=1, intensity=5, scanlimit=7): '''Constructor ScanLimit set to 7 Intensity set to 5 out of 0:15 Uses GPIOs 23, 24 25 as DIN, CS, and CLK respectively''' GP = GPIOProcessor() global DIN global CS global CLK DIN = GP.getPin34() # Gpio CS = GP.getPin33() # Gpio CLK = GP.getPin32() # Gpio DIN.out() CS.out() CLK.out() global numOfDevices numOfDevices = devices for i in range(0,numOfDevices): self.shutDown(False,i+1) for i in range(0,numOfDevices): self.setScanLimit(scanlimit,i+1) for i in range(0,numOfDevices): self.setIntensity(intensity,i+1) self.clearDisplays() global Characters Characters = AL()
[0, 0, 0, 1], ] FULL_STEP_SEQUENCE = [ [1, 1, 0, 0], [0, 1, 1, 0], [0, 0, 1, 1], [1, 0, 0, 1], ] try: steps_made = 0 pins = [ GP.getPin31(), GP.getPin32(), GP.getPin33(), GP.getPin34(), ] for p in pins: p.out() right = GP.getPin27() right.input() left = GP.getPin26() left.input() reset = GP.getPin24() reset.input() sequence = FULL_STEP_SEQUENCE