kopia lustrzana https://github.com/micropython/micropython-lib
drivers/led/neopixel: Fix test formatting.
Signed-off-by: Tom Mount <tmountjr@gmail.com>pull/739/head
rodzic
6ca933b9f2
commit
1f1f51d57c
|
@ -7,20 +7,23 @@ def neopixel_test():
|
|||
print("Fill with a color.")
|
||||
np.fill((255, 128, 64))
|
||||
print("Verify the bytes to be written")
|
||||
expected_bytearray = bytearray([255, 128, 64, 255, 128, 64, 255, 128, 64])
|
||||
actual_bytearray = np.buf
|
||||
print(f'Initial fill: {"passed" if expected_bytearray == actual_bytearray else "failed"}.')
|
||||
expected = bytearray([255, 128, 64, 255, 128, 64, 255, 128, 64])
|
||||
actual = np.buf
|
||||
passed = "passed" if expected == actual else "failed"
|
||||
print(f"Initial fill: {passed}.")
|
||||
print()
|
||||
|
||||
print("Change brightness of all pixels.")
|
||||
np.brightness(0.5)
|
||||
expected_bytearray = bytearray([127, 64, 32, 127, 64, 32, 127, 64, 32])
|
||||
actual_bytearray = np.buf
|
||||
print(f'Brightness change: {"passed" if expected_bytearray == actual_bytearray else "failed"}.')
|
||||
expected = bytearray([127, 64, 32, 127, 64, 32, 127, 64, 32])
|
||||
actual = np.buf
|
||||
passed = "passed" if expected == actual else "failed"
|
||||
print(f"Brightness change: {passed}.")
|
||||
print()
|
||||
|
||||
print("Get current brightness.")
|
||||
expected_brightness = 0.5
|
||||
actual_brightness = np.brightness()
|
||||
print(f'Brightness get: {"passed" if expected_brightness == actual_brightness else "failed"}.')
|
||||
expected = 0.5
|
||||
actual = np.brightness()
|
||||
passed = "passed" if expected == actual else "failed"
|
||||
print(f"Brightness get: {passed}.")
|
||||
print()
|
||||
|
|
Ładowanie…
Reference in New Issue