Join Olivia Stone for an in-depth discussion in this video Switch with a threshold value, part of Learning Lego Mindstorms.
- [Voiceover] Instead of looking for a specific value…my cases can be based on a threshold value.…I've replaced a light sensor with the IR sensor…and opened the program 06_04_Switch_IR_Start.…I want my robot to turn around…if there's an object directly in front of it…and to move in a straight line otherwise.…I'll set my switch block…to infrared sensor compare proximity.…When an object is too close…the value from the IR sensor will be below 20,…which I'll set as the threshold value.…When using a threshold as my switch test,…I can only have two cases,…true and false, which are indicated by the checkmark and X.…
The switch block will pick the true case…when the proximity value from the IR sensor…is less than the threshold value.…I'll place the move steering block…with turning in the true case.…And the other move steering block…in the false case.…With a pile of objects in front of my robot…I'll run this program.…(electronic chiming)…(whirring)…My robot turns away from it because it was too close.…Now I'll place my robot further away…
Learn how to unpack the hardware, connect to the programming interface, run prebuilt programs, and control the motors and sensors. Chapter 6, "Adding Flow to a Program," covers advanced programming topics such as transferring data between blocks, using variables to store temporary data, programming conditional logic, and looping actions to run again and again. By the end of the course, you'll have the skills to bring your own robotic creations to life.
- Installing the LEGO Mindstorms software
- Exploring the programming interface
- Connecting to the EV3 brick
- Downloading and running prebuilt programs
- Coordinating motor movement
- Calibrating the sensors
- Transferring data with data wires
- Adding logic with switch blocks
- Looping actions
- Troubleshooting problems with LEGO Mindstorms
- Broadcasting sounds and displaying images
- Updating LEGO Mindstorms
Skill Level Beginner
1. Getting Started
3. Explore a New Project
4. Connect with the EV3 Brick
5. Program Movement and Sensing
6. Adding Flow to a Program
7. Document Your Work
8. Troubleshoot Problems
9. Extra Tools
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.