From 56274ea968e139d44ac7bfea5f7a869434487266 Mon Sep 17 00:00:00 2001 From: FTC Engineering Date: Fri, 12 Apr 2019 11:57:33 -0400 Subject: [PATCH] Updated Using Sensors (Blocks) (markdown) --- Using-Sensors-(Blocks).md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Using-Sensors-(Blocks).md b/Using-Sensors-(Blocks).md index edcc688..3fc74bb 100644 --- a/Using-Sensors-(Blocks).md +++ b/Using-Sensors-(Blocks).md @@ -7,15 +7,15 @@ Note that it will take an estimated 15 minutes to complete this task. | Modifying the Op Mode to Display Distance | | ---- | -| 1. Place the Robot Controller in Programming Mode. 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.

Click on the “MyFIRSTOpMode” project to open it for editing if it is not already opened. | -| 3. Click on the “Utilities” category on the left-hand side of your browser. Find and click on the “Telemetry” subcategory.

| -| 4. Select the “call telemetry.addData” block (the numeric version) and drag it to the spot in your “while” loop block immediately before the “telemetry.update” block.

| -| 5. Click and highlight the “key” text and change the text so it reads “Distance (cm)”.

| -| 6. Click and expand the “Sensors” category. Click on the “LynxI2cColorRangeSensor” subcategory. Click on and select the “call sensorColorRange.getDistance” programming block.

Note that earlier versions of the FTC Blocks Programming tool refer to the REV Robotics Color-Distance Sensor as the "LynxI2cColorRangeSensor". Newer versions of the software refer to the device as the "REV Color/Range Sensor". | -| 7. Drag the “call sensorColorRange.getDistance” programming block to the “number” field of the “call telemetry.addData” programming block.

This will send the measured distance to the target in centimeters back to the Driver Station. | -| 8. Save your op mode and verify that it was saved successfully to the Robot Controller.

| -| 9. Follow the procedure outlined in the section titled [Running Your Op Mode](https://github.com/ftctechnh/ftc_app/wiki/Running-Your-Op-Mode) to run your updated op mode.

As you run the op mode, if you move your hand above the color light sensor, you should see the measured distance change on the Driver Station screen. If the expression “NaN” (not a number) is displayed on the Driver Station, the target is most likely out of range (and the sensor does not detect any reflected light). | +| 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.

Click on the “MyFIRSTOpMode” project to open it for editing if it is not already opened. | +| 3. Click on the “Utilities” category on the left-hand side of your browser. Find and click on the “Telemetry” subcategory.

| +| 4. Select the “call telemetry.addData” block (the numeric version) and drag it to the spot in your “while” loop block immediately before the “telemetry.update” block.

| +| 5. Click and highlight the “key” text and change the text so it reads “Distance (cm)”.

| +| 6. Click and expand the “Sensors” category. Click on the “REV Color/Range Sensor” subcategory. Click on and select the “call sensorColorRange.getDistance” programming block.

Note that earlier versions of the FTC Blocks Programming tool refer to the REV Robotics Color-Distance Sensor as the "LynxI2cColorRangeSensor". Newer versions of the software refer to the device as the "REV Color/Range Sensor". | +| 7. Drag the “call sensorColorRange.getDistance” programming block to the “number” field of the “call telemetry.addData” programming block.

This will send the measured distance to the target in centimeters back to the Driver Station. | +| 8. Save your op mode and verify that it was saved successfully to the Robot Controller.

| +| 9. Follow the procedure outlined in the section titled [Running Your Op Mode](https://github.com/ftctechnh/ftc_app/wiki/Running-Your-Op-Mode) to run your updated op mode.

As you run the op mode, if you move your hand above the color light sensor, you should see the measured distance change on the Driver Station screen. If the expression “NaN” (not a number) is displayed on the Driver Station, the target is most likely out of range (and the sensor does not detect any reflected light). | ### Touch Sensor