raw = sense.get_compass_raw() # Button für das Zeichnen wird gedrückt if event.type == Draw and zeichnen is True: # Formatierung und Berechnung der Position des Stiftes xsense = "{x}".format(**raw) ysense = "{y}".format(**raw) xsense = float(xsense) ysense = float(ysense) xsense = round(xsense) ysense = round(ysense) # Multiplikation mit negativer Zahl, weil der SenseHat in Normalposition negative Zahlen anzeigt lastPos = ((ysense * -10) + 350, (xsense * -10) - 200) pygame.draw.circle(screen, aktuelleFarbe, lastPos, radius) pygame.display.update() pygame.time.delay(100)