2024_10_01 - Dutton-Christian-Robotics/Learning-to-Code GitHub Wiki

  • 720 minutes left (show timer on iPad?)

Review

  • Ask: what did we do last time? What did we learn?
  • cases
  • mecanum wheels
    • "holonomic drivetrain"
    • AKA Swedish Wheel, Lion Wheel
  • Emphasize:
    • DRY
    • scope

Activities

  • Copy/Paste DryDriving1OpMode
  • Have them drive in a square
    • Notice the repetition involved in calling those methods
  • Introduce loops: how to do things over and over
    • introduce concept of boolean variables
    • for loop: known number of times
    • while loop: check condition before hand; not guaranteed to execute!
    • do/while loop: checks condition at the end; guaranteed to execute once
  • What if:
    • we end up having multiple OpModes, all with the same robot setup and movement code?
    • what if we want to make a small change

Concepts

  • Separation of Concerns
    • our opmode is doing two things right now: explaining a robot and using a robot
    • split those two things up and put robot in another class

Activities (as time allows)

  • Copy/Paste DryRobot and DryerDrivingOpMode
    • Code in the strafe methods
    • What is getting repeated most in our robot?
  • Use sensors
    • introduce whileOpModeIsActive()
    • introduce if for conditions