From effa16809f9a95bbae8a91a9e1edad45feb875e2 Mon Sep 17 00:00:00 2001 From: FTC Engineering Date: Fri, 12 Apr 2019 13:48:07 -0400 Subject: [PATCH] Updated Using Sensors (Blocks) (markdown) --- Using-Sensors-(Blocks).md | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Using-Sensors-(Blocks).md b/Using-Sensors-(Blocks).md index 1e96f87..90ad323 100644 --- a/Using-Sensors-(Blocks).md +++ b/Using-Sensors-(Blocks).md @@ -33,15 +33,13 @@ Note that it will take an estimated 15 minutes to complete this task. | ---- | | 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.

Click on the “MyFIRSTOpMode” project to open it for editing if it is not already opened. | -| 3. If it's not already expanded, click on the “Sensors” category to expand it. If you configured the touch sensor as a digital device, you should see the “Digital Channel” subcategory. Click on “Digital Channel” to display the list of available programming blocks.

| -| 4. Select the “set digitalTouch.Mode to” block and drag it to the position after the “Put initialization blocks here” comment. By default, this block will set the digital channel named “digitalTouch” to input mode.

| -| 5. Click on the “Logic” category. Find and click on the “if do else” block.

| -| 6. Drag the “if do else” block to the position before the “telemetry.update” block.

| -| 7. Click on the “Other Devices” category to expand it. Click on the “Digital Channel” subcategory, then find and select the “digitalTouch.State” block.

| -| 8. Drag the “digitalTouch.State” block to the test condition of the “if do else” programming block.

| -| 9. Click on the “Utilities” category on the left-hand side of your browser. Find and click on the “Telemetry” subcategory.

Select the “call telemetry.addData” block (the numeric version) and drag it to the “do” clause of the “if do else” block. | -| 10. Change the “key” value to “digitalTouch” and the “text” value to “NOT pressed (HIGH)”.

If the op mode detects that the “digitalTouch” channel is HIGH, it will send a telemetry message indicating that the button is not pressed. | -| 11. Change the “key” value to “digitalTouch” and the “text” value to “NOT pressed (HIGH)”.

If the op mode detects that the “digitalTouch” channel is HIGH, it will send a telemetry message indicating that the button is not pressed. | -| 12. Save your op mode and verify that it was saved successfully to the Robot Controller.

| -| 13. 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 and push or release the button, the telemetry message on the Driver Station should update to reflect the current state of the digital Touch Sensor. | +| 3. Click on the “Logic” category. Find and click on the “if do else” block.

| +| 4. Drag the “if do else” block to the position before the “telemetry.update” block.

| +| 5. Click on the "Sensors" category to expand it (if it isn't already expanded). Click on the "Touch Sensor" subcategory, then find and select the ".isPressed" block.

| +| 6. Drag the “isPressed” block to the test condition of the “if do else” programming block.

| +| 7. Click on the “Utilities” category on the left-hand side of your browser. Find and click on the “Telemetry” subcategory.

Select the “call telemetry.addData” block (the text version) and drag it to the “do” clause of the “if do else” block. | +| 8. Change the “key” value to “testTouch” and the “text” value to “is pressed”.

| +| 9. Insert another "telemetry.addData" block (the text version) to the "else" clause of the "if do else" block. Change the “key” value to “testTouch” and the “text” value to “is NOT pressed”.

| +| 10. Save your op mode and verify that it was saved successfully to the Robot Controller.

| +| 11. 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 and push or release the button, the telemetry message on the Driver Station should update to reflect the current state of the digital Touch Sensor. |