- :-

Topics Covered

  • Advanced Functions
  • Lesson Links

    Check Your Understanding:
    1. 1. True / False: A function cannot return a float variable type.
    2. True
      False
    3. 2. True / False: Functions follow the same naming rules as variables.
    4. True
      False
    5. 3. The ROBOTC reserved word "return" does which of the following?
    6. Allows more than one function to be called in the task main
      Allows the function to return the calculated result of the function
      Allows the variable to store large numbers
      Allows the function to store whole number data types
    Calculate Distance Function - Mini Challenge

    Mini Challenge 1: Going the Distance Challenge

    At the beginning of the challenge, make sure that the robot is placed so the sensor is slightly past the starting line.

    The robot will travel from the starting line to line one and record the distance that it traveled.

    The robot will then return to the start.

    The robot will then drive forward double the distance and return to the start again.

    Finally, the robot will travel triple the distance and then return back to the start.

    The distance from the start to line one will be random.
    • Recreate the table below on any surface, and start at one end of the table (1).

    Mini Challenge PDF[ Going the Distance Challenge.pdf ]