checking, if timings can be improved.
This commit is contained in:
parent
a926a22a5e
commit
a3ee44af95
@ -88,10 +88,6 @@ class UnicornHat(object):
|
|||||||
return self._rotation * 90
|
return self._rotation * 90
|
||||||
|
|
||||||
|
|
||||||
def set_layout(self, *args):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
def off(self):
|
def off(self):
|
||||||
print("Closing window")
|
print("Closing window")
|
||||||
pygame.quit()
|
pygame.quit()
|
||||||
|
@ -44,7 +44,7 @@ class UnicornHat(object):
|
|||||||
for x in range(len(buf1)):
|
for x in range(len(buf1)):
|
||||||
b1, b2= buf1[x], buf2[x]
|
b1, b2= buf1[x], buf2[x]
|
||||||
self.spi_write_byte(b1, b2)
|
self.spi_write_byte(b1, b2)
|
||||||
time.sleep(0.0000001)
|
#time.sleep(0.0000001)
|
||||||
|
|
||||||
GPIO.output(self.PIN_CS, GPIO.HIGH)
|
GPIO.output(self.PIN_CS, GPIO.HIGH)
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ class UnicornHat(object):
|
|||||||
GPIO.output(self.PIN_CLK, GPIO.HIGH)
|
GPIO.output(self.PIN_CLK, GPIO.HIGH)
|
||||||
b1 <<= 1
|
b1 <<= 1
|
||||||
b2 <<= 1
|
b2 <<= 1
|
||||||
time.sleep(0.00000001)
|
#time.sleep(0.00000001)
|
||||||
GPIO.output(self.PIN_CLK, GPIO.LOW)
|
GPIO.output(self.PIN_CLK, GPIO.LOW)
|
||||||
|
|
||||||
def set_brightness(self, b):
|
def set_brightness(self, b):
|
||||||
@ -74,10 +74,6 @@ class UnicornHat(object):
|
|||||||
"""Returns the display rotation in degrees."""
|
"""Returns the display rotation in degrees."""
|
||||||
return self.rotation * 90
|
return self.rotation * 90
|
||||||
|
|
||||||
def set_layout(self, pixel_map=None):
|
|
||||||
"""Does nothing, for library compatibility with Unicorn HAT."""
|
|
||||||
pass
|
|
||||||
|
|
||||||
def set_all(self, r, g, b):
|
def set_all(self, r, g, b):
|
||||||
self.buffer[:] = r, g, b
|
self.buffer[:] = r, g, b
|
||||||
|
|
||||||
@ -93,6 +89,7 @@ class UnicornHat(object):
|
|||||||
|
|
||||||
|
|
||||||
def set_matrix(self, matrix):
|
def set_matrix(self, matrix):
|
||||||
|
"""Sets a height x width matrix directly"""
|
||||||
self.buffer = matrix
|
self.buffer = matrix
|
||||||
self.show()
|
self.show()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user