Scrimmage update after run 2
well at least yellow works now.
This commit is contained in:
@@ -15,6 +15,7 @@ drive_base.use_gyro(True)
|
||||
color_sensor = ColorSensor(Port.F)
|
||||
Color.ORANGE = Color(37, 85, 95)
|
||||
Color.BLUE = Color(230,100,100)
|
||||
Color.YELLOW = Color(37, 85, 95)
|
||||
color_sensor.detectable_colors([Color.ORANGE, Color.BLUE, Color.GREEN, Color.WHITE, Color.RED, Color.YELLOW])
|
||||
hub.speaker.volume(50) # Set the volume of the speaker
|
||||
color_sensor.detectable_colors()
|
||||
@@ -149,7 +150,7 @@ async def celebrate_mission_complete(sound_type=CelebrationSound.SUCCESS_CHIME):
|
||||
hub.light.off()
|
||||
|
||||
async def Run1():
|
||||
left_arm.run_angle(1000, 300)
|
||||
left_arm.run_angle(1000, -300)
|
||||
right_arm.run_angle(1000,500)
|
||||
await drive_base.straight(320)
|
||||
await right_arm.run_angle(5000,-500, Stop.HOLD)
|
||||
@@ -167,12 +168,12 @@ async def Run1():
|
||||
await drive_base.straight(-145)
|
||||
await drive_base.turn(-60)
|
||||
await drive_base.straight(90)
|
||||
await left_arm.run_angle(1000,-450)
|
||||
await left_arm.run_angle(1000, 450)
|
||||
await drive_base.straight(-145)
|
||||
await left_arm.run_angle(1000,450)
|
||||
await left_arm.run_angle(1000,-450)
|
||||
await drive_base.straight(10)
|
||||
await drive_base.turn(35)
|
||||
await drive_base.straight(-600)
|
||||
await drive_base.straight(-700)
|
||||
|
||||
async def Run2():
|
||||
await drive_base.straight(200)
|
||||
@@ -188,7 +189,7 @@ async def Run2():
|
||||
await right_arm.run_angle(350,-1000)
|
||||
await drive_base.straight(-100)
|
||||
await drive_base.turn(-100)
|
||||
await drive_base.straight(-600)
|
||||
await drive_base.straight(-750)
|
||||
|
||||
|
||||
async def Run3():
|
||||
@@ -248,7 +249,7 @@ async def main():
|
||||
|
||||
color_detected = await color_sensor.color()
|
||||
print(f'Detected color: {color_detected.h}, {color_detected.s}, {color_detected.v}')
|
||||
if color_reflected_percent > 0:
|
||||
if color_reflected_percent > 1:
|
||||
if color_detected == Color.GREEN:
|
||||
print('Running Mission 1')
|
||||
await Run1()
|
||||
|
||||
Reference in New Issue
Block a user