Updated Using Sensors (Blocks) (markdown)
@ -15,7 +15,7 @@ Note that it will take an estimated 15 minutes to complete this task.
|
|||||||
| 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.<br/><br/><p align="center"><img src="https://github.com/FIRST-Tech-Challenge/WikiSupport/blob/master/ftc_app/images/DistanceSensorStep6ControlHub.jpg" width="600"></p>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". |
|
| 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.<br/><br/><p align="center"><img src="https://github.com/FIRST-Tech-Challenge/WikiSupport/blob/master/ftc_app/images/DistanceSensorStep6ControlHub.jpg" width="600"></p>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.<br/><br/><p align="center"><img src="https://github.com/FIRST-Tech-Challenge/WikiSupport/blob/master/ftc_app/images/DistanceSensorStep7ControlHub.jpg" width="500"></p>This will send the measured distance to the target in centimeters back to the Driver Station. |
|
| 7. Drag the “call sensorColorRange.getDistance” programming block to the “number” field of the “call telemetry.addData” programming block.<br/><br/><p align="center"><img src="https://github.com/FIRST-Tech-Challenge/WikiSupport/blob/master/ftc_app/images/DistanceSensorStep7ControlHub.jpg" width="500"></p>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.<br/><br/><p align="center"><img src="https://github.com/FIRST-Tech-Challenge/WikiSupport/blob/master/ftc_app/images/DistanceSensorStep8ControlHub.jpg" width="500"></p> |
|
| 8. Save your op mode and verify that it was saved successfully to the Robot Controller.<br/><br/><p align="center"><img src="https://github.com/FIRST-Tech-Challenge/WikiSupport/blob/master/ftc_app/images/DistanceSensorStep8ControlHub.jpg" width="500"></p> |
|
||||||
| 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.<br/><br/><p align="center"><img src="https://github.com/FIRST-Tech-Challenge/WikiSupport/blob/master/ftc_app/images/DistanceSensorStep9ControlHub.jpg" width="175"></p>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). |
|
| 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.<br/><br/><p align="center"><img src="https://github.com/FIRST-Tech-Challenge/WikiSupport/blob/master/ftc_app/images/DistanceSensorStep9ControlHub.jpg" width="350"></p>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
|
### Touch Sensor
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user