dev #15

Merged
Arcmyx merged 4 commits from dev into main 2026-01-22 22:26:18 +00:00
2 changed files with 7 additions and 13 deletions
Showing only changes of commit 8489a87ada - Show all commits

View File

@@ -1,13 +1,13 @@
from pybricks.tools import wait, StopWatch from pybricks.tools import wait, StopWatch
from pybricks.parameters import Port
from pybricks import version from pybricks import version
import OtherFunctions as debug import OtherFunctions as debug
import usys import usys
print("Pybricks version information:", version)
print("MicroPython information:", usys.implementation)
print("MicroPython version:", usys.version)
class HubDiagnostics: class HubDiagnostics:
def __init__(self, hub): def __init__(self, hub):
self.hub = hub
self.port_map = { self.port_map = {
"A": Port.A, "A": Port.A,
"B": Port.B, "B": Port.B,
@@ -16,20 +16,13 @@ class HubDiagnostics:
"E": Port.E, "E": Port.E,
"F": Port.F, "F": Port.F,
} }
def printAbout(self):
print("Pybricks version information:", version)
print("MicroPython information:", usys.implementation)
print("MicroPython version:", usys.version)
def testLightSources(self, verbose): def testLightSources(self, verbose):
v = verbose v = verbose
self.hub.display.off() self.hub.display.off()
for x in range(5): for x in range(5):
for y in range(5): for y in range(5):
debug.log(f"Turning on pixel at position {x}, {y}...", v) debug.log(f"Turning on pixel at position {x}, {y}...", v)
self.hub.display.pixel(x, y, brightness=100) display.pixel(x, y, brightness=100)
wait(100) wait(100)
debug.log(f"Turning off pixel at position {x}, {y}...", v) debug.log(f"Turning off pixel at position {x}, {y}...", v)
self.hub.display.pixel(x, y, brightness=0) display.pixel(x, y, brightness=0)
def printAll(self):
self.printAbout()
self.testLightSources(False)

View File

@@ -1,3 +1,4 @@
def log(string, verbose): verbose = True
def log(string):
if(verbose): if(verbose):
print("[LOG (verbose)]", string) print("[LOG (verbose)]", string)