Teacher Notes: Pro Preview

Today's lesson has no new material to teach the students. Instead, the students should revise and solidify their knowledge and you should focus on those students that are falling behind.

Try your best to teach them agency so that they do not fall behind again.

At the end of the lesson, direct all of the students to the last of the additional tasks.

To access the full video please subscribe to FLLCasts.com

Subscribe

  • #1621
  • 20 Jun 2020

Example solution to the task "Program the robot to dynamically check the right touch sensor (with an "if" statement in a loop) and to drive the right motor infinitely when pressed.":

# Create your objects here. 
ev3 = EV3Brick() 

right_touch = TouchSensor(Port.S2) 
right_motor = Motor(Port.C) 

# Write your program here. 
ev3.speaker.beep() 

while True:
    if right_touch.pressed():
        right_motor.run(1000)

Example solution to the task "Program the robot to drive the right motor indefinitely in the opposite direction if the right touch sensor is NOT pressed.":

# Create your objects here.
ev3 = EV3Brick()

right_touch = TouchSensor(Port.S2)
right_motor = Motor(Port.C)

# Write your program here. 
ev3.speaker.beep()

while True:
    if right_touch.pressed():
        right_motor.run(1000)
    else:
        right_motor.run(-1000)

Example solution to the task "Change your program so that the robot checks the left touch sensor and to drive the left motor.":

# Create your objects here. 
ev3 = EV3Brick() 

left_touch = TouchSensor(Port.S1) 
left_motor = Motor(Port.B) 

# Write your program here.  
ev3.speaker.beep() 

while True: 
    if left_touch.pressed(): 
        left_motor.run(1000) 
    else: 
        left_motor.run(-1000)

Example solution to the task "Program your robot to dynamically check both sensors and drive their respective motors.":

# Create your objects here. 
ev3 = EV3Brick() 

right_touch = TouchSensor(Port.S2)
left_touch = TouchSensor(Port.S1) 

right_motor = Motor(Port.C)
left_motor = Motor(Port.B)

# Write your program here.  
ev3.speaker.beep() 

while True:

    if right_touch.pressed():
        right_motor.run(1000)
    else:
        right_motor.run(-1000)

    if left_touch.pressed():   
        left_motor.run(1000)   
    else:   
        left_motor.run(-1000)

Example solution to the task "Change your program so that instead of the robot moving back, it stops its motors when their respective touch sensors are not pressed.":

# Create your objects here. 
ev3 = EV3Brick() 

right_touch = TouchSensor(Port.S2)
left_touch = TouchSensor(Port.S1) 

right_motor = Motor(Port.C)
left_motor = Motor(Port.B)

# Write your program here.  
ev3.speaker.beep() 

while True:

    if right_touch.pressed():
        right_motor.run(1000)
    else:
        right_motor.brake()

    if left_touch.pressed():   
        left_motor.run(1000)   
    else:   
        left_motor.brake()

Courses and lessons with this Tutorial

This Tutorial is used in the following courses and lessons

Image for Python with LEGO Mindstorms EV3 - Level 2
  • 39
  • 19:58
  • 93
Image for Lesson 4 - Rescue robot with remote control
  • 1
  • 3
  • 12
  • 3d_rotation 1