Update codes_for_scrimmage/hazmat/hazmat_main.py
This commit is contained in:
@@ -29,13 +29,11 @@ print("Default Detected Colors:", color_sensor.detectable_colors())
|
|||||||
|
|
||||||
# Custom color Hue, Saturation, Brightness value for Lego bricks
|
# Custom color Hue, Saturation, Brightness value for Lego bricks
|
||||||
Color.MAGENTA = Color(300,100,100)
|
Color.MAGENTA = Color(300,100,100)
|
||||||
Color.VIOLET = Color(270,100,100)
|
Color.VIOLET = Color(277,68,32)
|
||||||
Color.ORANGE = Color(17,78,15)
|
|
||||||
Color.BLUE = Color(240,100,100)
|
Color.BLUE = Color(240,100,100)
|
||||||
Color.CYAN = Color(180,100,100)
|
Color.CYAN = Color(180,100,100)
|
||||||
|
|
||||||
LEGO_BRICKS_COLOR = [
|
LEGO_BRICKS_COLOR = [
|
||||||
Color.ORANGE,
|
|
||||||
Color.BLUE,
|
Color.BLUE,
|
||||||
Color.GREEN,
|
Color.GREEN,
|
||||||
Color.WHITE,
|
Color.WHITE,
|
||||||
@@ -349,7 +347,7 @@ async def main():
|
|||||||
print(color_reflected_percent)
|
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
|
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}')
|
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')
|
print('Running Mission 5')
|
||||||
await Run5()
|
await Run5()
|
||||||
#await celebrate_mission_complete(CelebrationSound.LEVEL_UP)
|
#await celebrate_mission_complete(CelebrationSound.LEVEL_UP)
|
||||||
elif color_detected == Color.ORANGE:
|
elif color_detected == Color.VIOLET:
|
||||||
print('Running Mission 6')
|
print('Running Mission 6')
|
||||||
await Run6()
|
await Run6()
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user