From f28ec4994d085a431637db7b7d179ebf6025d84c Mon Sep 17 00:00:00 2001 From: Atharv Nagavarapu <30nagava@elmbrookstudents.org> Date: Wed, 17 Dec 2025 17:04:25 +0000 Subject: [PATCH] Update diagnostics/HubDiagnostics.py --- diagnostics/HubDiagnostics.py | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/diagnostics/HubDiagnostics.py b/diagnostics/HubDiagnostics.py index 6e1831c..add8727 100644 --- a/diagnostics/HubDiagnostics.py +++ b/diagnostics/HubDiagnostics.py @@ -4,12 +4,30 @@ from pybricks.parameters import Button, Color, Direction, Port, Side, Stop from pybricks.robotics import DriveBase from pybricks.tools import wait, StopWatch from pybricks import version +from OtherFunctions import vprint import usys -hub = PrimeHub() print("Pybricks version information:", version) print("MicroPython information:", usys.implementation) print("MicroPython version:", usys.version) -while True: - print(str(hub.imu.heading())) - # Insert display test here, with input to either test hub gyro stats or display or info. \ No newline at end of file +class HubDiagnostics: + def __init__(self): + self.hub = PrimeHub() + 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 + hub.display.off() + for x in range(5): + for y in range(5): + vprint(f"Turning on pixel at position {x}, {y}...", v) + display.pixel(x, y, brightness=100) + wait(100) + vprint(f"Turning off pixel at position {x}, {y}...", v) + display.pixel(x, y, brightness=0)