Update diagnostics-old/HubDiagnostics.py
This commit is contained in:
33
diagnostics-old/HubDiagnostics.py
Normal file
33
diagnostics-old/HubDiagnostics.py
Normal file
@@ -0,0 +1,33 @@
|
||||
from pybricks.hubs import PrimeHub
|
||||
from pybricks.pupdevices import Motor, ColorSensor, UltrasonicSensor, ForceSensor
|
||||
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
|
||||
|
||||
print("Pybricks version information:", version)
|
||||
print("MicroPython information:", usys.implementation)
|
||||
print("MicroPython version:", usys.version)
|
||||
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)
|
||||
Reference in New Issue
Block a user