if not spidev.open (), then simply paste, how it should look like?
for example in the upper or this code:
def __init__(self,spd=1000000):
spi.openSPI(speed=spd)
# GPIO.setmode(GPIO.BOARD)
# GPIO.setup(22, GPIO.OUT)
# GPIO.output(self.NRSTPD, 1)
self.MFRC522_Init()
I see!))
I try.
class APA102:
def __init__(self, numLEDs, globalBrightness = 31, order='rgb'): # The number of LEDs in the Strip
self.numLEDs = numLEDs
order = order.lower()
self.rgb = rgb_map.get(order, rgb_map['rgb'])
# LED startframe is three "1" bits, followed by 5 brightness bits
self.ledstart = (globalBrightness & 0b00011111) | 0b11100000 # Don't validate, just slash of extra bits
self.leds = [self.ledstart,0,0,0] * self.numLEDs # Pixel buffer
self.spi = spidev.SpiDev() # Init the SPI device
self.spi.open(1, 0) # Open SPI port 1, slave device (CS) 1
self.spi.max_speed_hz=16000000 # Up the speed a bit, so that the LEDs are painted faster 8 000 000 is default