dev #32
@@ -29,13 +29,11 @@ print("Default Detected Colors:", color_sensor.detectable_colors())
|
||||
|
||||
# Custom color Hue, Saturation, Brightness value for Lego bricks
|
||||
Color.MAGENTA = Color(300,100,100)
|
||||
Color.VIOLET = Color(270,100,100)
|
||||
Color.ORANGE = Color(17,78,15)
|
||||
Color.VIOLET = Color(277,68,32)
|
||||
Color.BLUE = Color(240,100,100)
|
||||
Color.CYAN = Color(180,100,100)
|
||||
|
||||
LEGO_BRICKS_COLOR = [
|
||||
Color.ORANGE,
|
||||
Color.BLUE,
|
||||
Color.GREEN,
|
||||
Color.WHITE,
|
||||
@@ -349,7 +347,7 @@ async def main():
|
||||
print(color_reflected_percent)
|
||||
|
||||
|
||||
if color_reflected_percent > 5: # Make sure we actually have color reflections before checking for color
|
||||
if color_reflected_percent > 0: # Make sure we actually have color reflections before checking for color
|
||||
color_detected = await color_sensor.color() # Moved this inside the if clause
|
||||
print(f'Detected color:{color_detected} : {color_detected.h}, {color_detected.s}, {color_detected.v}')
|
||||
|
||||
@@ -373,7 +371,7 @@ async def main():
|
||||
print('Running Mission 5')
|
||||
await Run5()
|
||||
#await celebrate_mission_complete(CelebrationSound.LEVEL_UP)
|
||||
elif color_detected == Color.ORANGE:
|
||||
elif color_detected == Color.VIOLET:
|
||||
print('Running Mission 6')
|
||||
await Run6()
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user