Saved searches

Use saved searches to filter your results more quickly

Cancel Create saved search Sign up Reseting focus

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Using Sensors (Blocks)

FTC Engineering edited this page Jul 9, 2019 · 7 revisions

Color-Distance Sensor

A sensor is a device that lets the Robot Controller get information about its environment. In this example, you will use a REV Robotics Color-Distance sensor to display range (distance from an object) info to the driver station.

The Color-Range sensor uses reflected light to determine the distance from the sensor to the target object. It can be used to measure close distances (up 5” or more) with reasonable accuracy. Note that at the time this document was most recently edited, the REV Color-Range sensor saturates around 2” (5cm). This means that for distances less than or equal to 2”, the sensor returns a measured distance equal to 2” or so.

Note that it will take an estimated 15 minutes to complete this task.

Modifying the Op Mode to Display Distance
1. Verify that your laptop is still connected to the Robot Controller’s Program & Manage Wi-Fi network.
2. Verify that “MyFIRSTOpMode” is opened for editing. If it is not, you can click on the FIRST logo in the upper left hand corner of the browser window on the laptop. This should take you to the main FTC Blocks Development Tool project screen.

Touch Sensor

For this example, we assume that the REV Robotics Touch Sensor has been configured as a digital touch sensor in the Robot Controller's active configuration file. We will use the "isPressed" programming block to determine if the button on the sensor is currently pressed or not.

The Expansion Hub digital ports contain two digital pins per port. When you use a 4-wire JST cable to connect a REV Robotics Touch sensor to an Expansion Hub digital port, the Touch Sensor is wired to the second of the two digital pins within the port. The first digital pin of the 4-wire cable remains disconnected.

For example, if you connect a Touch Sensor to the “0,1” digital port of the Expansion Hub, the Touch Sensor will be connected to the second pin (labeled “1”) of the port. The first pin (labeled “0”) will stay disconnected.

Note that it will take an estimated 15 minutes to complete this task.

Modifying the Op Mode to Display Button (Touch Sensor) State
1. Verify that your laptop is still connected to the Robot Controller’s Programming Mode Wi-Fi network.
2. Verify that “MyFIRSTOpMode” is opened for editing. If it is not, you can click on the FIRST logo in the upper left hand corner of the browser window on the laptop. This should take you to the main FTC Blocks Development Tool project screen.