mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-15 02:54:52 +00:00
21 lines
408 B
Python
21 lines
408 B
Python
from pybricks.hubs import PrimeHub
|
|
from pybricks.tools import wait
|
|
|
|
# Initialize the hub.
|
|
hub = PrimeHub()
|
|
|
|
# Turn off all the pixels.
|
|
hub.display.off()
|
|
|
|
# Turn on the pixel at row 1, column 2.
|
|
hub.display.pixel(1, 2)
|
|
wait(2000)
|
|
|
|
# Turn on the pixel at row 2, column 4, at 50% brightness.
|
|
hub.display.pixel(2, 4, 50)
|
|
wait(2000)
|
|
|
|
# Turn off the pixel at row 1, column 2.
|
|
hub.display.pixel(1, 2, 0)
|
|
wait(2000)
|