Files
pynamics/diagnostics/HubDiagnostics.py

29 lines
927 B
Python
Raw Normal View History

2025-12-18 16:42:55 +00:00
from pybricks.tools import wait, StopWatch
from pybricks import version
2025-12-18 19:22:25 +00:00
import OtherFunctions as debug
2025-12-18 16:42:55 +00:00
import usys
print("Pybricks version information:", version)
print("MicroPython information:", usys.implementation)
print("MicroPython version:", usys.version)
class HubDiagnostics:
def __init__(self, hub):
self.port_map = {
"A": Port.A,
"B": Port.B,
"C": Port.C,
"D": Port.D,
"E": Port.E,
"F": Port.F,
}
def testLightSources(self, verbose):
v = verbose
self.hub.display.off()
for x in range(5):
for y in range(5):
2025-12-18 19:22:25 +00:00
debug.log(f"Turning on pixel at position {x}, {y}...", v)
2025-12-18 16:42:55 +00:00
display.pixel(x, y, brightness=100)
wait(100)
2025-12-18 19:22:25 +00:00
debug.log(f"Turning off pixel at position {x}, {y}...", v)
2025-12-18 16:42:55 +00:00
display.pixel(x, y, brightness=0)