Cruise Control

Connect

Make sure that you can answer the following questions:
– What factors can make drivers feel stressed while driving?
– How can we help improve drivers’ safety during long drives?

Think about what you have learned, then document it. Describe the problem in your own words. Creatively record your ideas and findings.

set-cruise-controle

Construct

Build
Start by constructing this model. Add two Touch Sensors to your model.

ev3-robot-color-sensor

Program
Create a cruise control program for your robot, like the ones found in many cars today. You will need to use two Touch Sensors to simulate the buttons found on the steering wheel of a car with cruise control.
The car will speed up in increments of ten when the Touch Sensor is pressed.
Use the Variable Block to define the “set” speed that can be added to. Ensure that the Move Steering Block mode is set to On instead of On for Seconds, Degrees, or Rotations.

Think about what you have learned, then document it. Describe your pseudocode for this task. Creatively record your ideas and findings.

Consider adding these blocks to your solution:

layout-ex-cbs-09

Contemplate

Improve your program: make your robot decelerate in increments of ten when the other Touch Sensor is pressed.
This can be done by adding a second loop and a Switch Block.
Inside the extra loop will be a second Touch Sensor, and a Math Block set to subtract rather than add. Remember that you will be using multitasking with two lines of programming running simultaneously.
Think about what you have learned, then document it. Describe your pseudocode for this task. Creatively record your ideas, and findings.

Consider adding these blocks to your solution:

multitasking

Differentiation Option
Improve your program: show the robot’s speed (motor power) on the EV3 Brick Display.
My Blocks might be useful at this point because they can save room on the programming screen, and subroutines (the My Blocks) can be used again in other programs you write. Ask your teacher for help if you would like to learn how to use My Blocks.

Think about what you have learned, then document it. Describe your pseudocode for this task. Creatively record your ideas and findings.

Share
Consider the following questions:
What challenged you? What surprised you about your programs?
Could your program have been more streamlined? Have you used too many blocks?
Is there a more efficient way of building your program?
How could your program be used in real-world scenarios?

Consider adding these blocks to your solution:

layout-ex-cbs-10

Continue

Explore text-based programming solutions for this activity and compare these solutions using different programming languages.