def run(self): global emulated while self.running: while not self.q.empty(): e = self.q.get() if e == 'Q': break for x in range(0,self.n): for y in range(0,self.n): i = 1 + y*self.n + x if self.pins[i]<27: GPIO.output(self.pins[i], int(self.lattice[self.layer,x,y])) GPIO.output(26,1) self.layer = (self.layer+1)%self.n GPIO.output(26,0) if emulated: GPIO.display(self) time.sleep(self.dt/1000)