The state of the Touch sensor is retrieved using the Touch Sensor block. The block can be used to only report the Touch sensor’s current state or to test whether it is pressed, released or bumped. Using the output data from the Touch Sensor block, the state of the sensor can be displayed on the brick’s display.
- View Offline
- Exercise Files
- [Voiceover] While I can see the data from the sensors…in the hardware page, I'm not capturing or storing the data…to use in my program.…I've opened 05_05_Touch_Start,…which is currently empty except for the Start block.…All the sensor blocks can be found in the Sensor palette,…which has a yellow tab.…The simplest sensor is a touch sensor.…To get data from the sensor, I use a touch sensor block.…This block has two modes.…Measure and compare.…In measure mode, the block will measure the state…of the sensor at the moment the block runs.…
This is very important to remember.…The value I get back will only be…at the moment this block runs.…Not the second before, or after,…or while the previous block is running.…I can run this right now, but the measured value…will be stored in the brick.…And it would be nice to do something with this value…so I can see what it is.…To see the value, I'll use display block…from the Actions palette.…This block is used to display text or graphics…on the EV3 Brick display.…
To show the measured state,…
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.