Blocks Programming Manual
Blocks Programming Manual
Blocks Programming Manual
Gracious Professionalism®
Gracious Professionalism® is a way of doing things that encourages high-quality work, emphasizes the value
of others, and respects individuals and the community.
Watch Dr. Woodie Flowers explain Gracious Professionalism in this short video.
Sponsor Thank You
Thank you to our generous sponsors for your continued support!
Revision History
Revision Date Description
1 07/15/2021 Initial Release
2 08/12/2021 Includes FTC Apps from Github and REV Hardware Client
Contents
Introduction ........................................................................................................................................................3
What is FIRST® Tech Challenge? .................................................................................................................. 3
Gracious Professionalism®................................................................................................................................. 3
1 Introduction .................................................................................................................................................7
Autonomous vs. Driver-Controlled .............................................................................................................. 7
1.1 Point-to-Point Control System.............................................................................................................. 7
1.2 REV Robotics Expansion Hub ............................................................................................................. 7
1.3 REV Robotics Control Hub .................................................................................................................. 8
2 Required Materials...................................................................................................................................... 9
3 Setting Up Your Smartphones .................................................................................................................. 12
3.1 What Needs to be Configured for My Control System? ...................................................................... 12
Users with Two Android Devices .............................................................................................................. 13
3.2 Renaming Your Devices .................................................................................................................... 13
3.3 Installing the FIRST Tech Challenge Apps ........................................................................................ 17
3.4 Placing Phones into Airplane Mode with Wi-Fi On ............................................................................. 25
3.5 Pairing the Driver Station to the Robot Controller .............................................................................. 27
4 Connecting Devices to an Expansion Hub ................................................................................................ 37
4.1 Connecting 12V Power to the Hub ..................................................................................................... 37
4.2 Connecting a Motor to the Hub .......................................................................................................... 39
4.3 Connecting a Servo to the Hub .......................................................................................................... 40
4.4 Connecting a Color-Distance Sensor to the Hub................................................................................ 42
4.5 Connecting a Touch Sensor to the Hub ............................................................................................. 43
5 Configuring Your Hardware on the Robot Controller ................................................................................. 44
5.1 Connecting an Android Smartphone to an Expansion Hub ................................................................ 44
5.2 Creating a Configuration File Using the Driver Station ....................................................................... 46
5.3 Configuring the DC Motor .................................................................................................................. 49
5.4 Configuring a Servo ........................................................................................................................... 51
5.5 Configuring a Color Distance Sensor ................................................................................................. 52
5.6 Configuring a Digital Touch Sensor ................................................................................................... 55
5.7 Saving the Configuration Information ................................................................................................. 57
6 Writing an Op Mode .................................................................................................................................. 59
6.1 What’s an Op Mode? ......................................................................................................................... 59
6.2 The FTC Blocks Programming Tool ................................................................................................... 59
6.3 Installing a Javascript-Enabled Browser ............................................................................................ 61
6.4 Connecting Your Laptop to the Program and Manage Network ......................................................... 62
6.5 Troubleshooting Your Wireless Connection ....................................................................................... 65
6.6 Creating Your First Op Mode ............................................................................................................. 65
6.7 Examining the Structure of Your Op Mode......................................................................................... 68
6.8 Modifying the Op Mode to Control a DC Motor .................................................................................. 69
6.9 Inserting Telemetry Statements ......................................................................................................... 74
6.10 Saving Your Op Mode ....................................................................................................................... 77
6.11 Exiting Programming Mode................................................................................................................ 78
7 Running Your Op Mode ............................................................................................................................ 78
8 Controlling a Servo Motor with an Op Mode.............................................................................................. 81
8.1 What is a Servo Motor? ..................................................................................................................... 81
8.2 Modifying Your Op Mode to Control a Servo ...................................................................................... 81
9 Using Sensors .......................................................................................................................................... 90
9.1 Color-Distance Sensor....................................................................................................................... 90
9.2 Touch Sensor .................................................................................................................................... 94
10 Troubleshooting .................................................................................................................................... 97
10.1 Manually Connecting to the Blocks Programming Mode Wi-Fi Network ............................................. 97
10.2 Troubleshooting Tips ......................................................................................................................... 99
10.2.1 Cannot See the Blocks Programming Mode Wireless Network ................................................... 99
10.2.2 “Save project failed. Error code 0.” ........................................................................................... 100
10.2.3 Op Mode Blocks Are Missing… ................................................................................................ 100
10.2.4 Driver Station Appears Unresponsive ....................................................................................... 102
10.2.5 Warning: problem communicating… ......................................................................................... 102
10.2.6 Additional Disconnect Incidents with Motorola E4, G5 and G5 Plus Phones ............................. 103
10.2.7 Wi-Fi Blocker at Venue ............................................................................................................. 105
Appendix A – Resources ............................................................................................................................... 107
Game Forum Q&A ..................................................................................................................................... 107
Volunteer Forum ........................................................................................................................................ 107
FIRST Tech Challenge Game Manuals ...................................................................................................... 107
FIRST Headquarters Pre-Event Support .................................................................................................... 107
FIRST Websites ......................................................................................................................................... 107
FIRST Tech Challenge Social Media .......................................................................................................... 107
Feedback ................................................................................................................................................... 107
1 Introduction
This document shows how to set up, configure, and program the control system used for the FIRST Tech
Challenge competition. The basic examples in this document use the REV Robotics Expansion Hub and the REV
Robotics Control Hub as the input/output module. For detailed information about the REV Robotics Expansion
Hub, refer to the REV Robotics Expansion Hub Guide which is available from the REV Robotics website
(http://www.revrobotics.com/).
Figure 1 – The control system has a Driver Station connected wirelessly to a Robot Controller.
The Robot Controller acts as the “brains” of the robot and is mounted on the frame of the robot. There are two
hardware options currently being used: REV Robotics Expansion Hub or the REV Robotics Control Hub.
A second Android device sits with the team drivers and has one or two gamepads connected. This second device
is known as the Driver Station. The Driver Station is sort of like a remote control that you might use to control your
television. The Driver Station allows a team to communicate remotely (using a secure, wireless connection) to the
Robot Controller and to issue commands to the Robot Controller. The Driver Station consists of an Android device
running an FTC Driver Station app.
The Expansion Hub is also connected to a 12V battery which is used to power the Expansion Hub, the motors,
the servos and sensors. If an Android smartphone is used as the Robot Controller, then the smartphone will have
its own independent battery. If a REV Robotics Control Hub is used as the Robot Controller, then the Control Hub
will use the main 12V battery to power its internal Android device.
2 Required Materials
To follow along with the examples in this document, you will need the following items:
Two (2) FIRST-approved Android
devices 1
Or
1 Consult the official FIRST Tech Challenge Game Manual, Part 1 for a list of approved devices. Is it worth linking to the GM?
REV Robotics Switch, Cable, and
Bracket (REV-31-1387)
2Note that for the examples listed in this document, it is recommended that the user builds a simple structure using a compatible build kit (such as
TETRIX Max) to properly secure the DC motor and prevent it from rolling about uncontrollably while running the sample op modes.
REV Robotics Touch sensor with 4-Pin
JST PH Cable (REV-31-1425)
• Rename the smartphone to "<TEAM NUMBER>-DS" (where <TEAM NUMBER> is replaced by your team
number).
• Install the Driver Station app onto the Driver Station device. Note: the REV Driver Hub has pre-installed
software.
• Put your phone into Airplane Mode (with the WiFi radio still on).
• Pair (i.e., wirelessly connect) the Driver Station to the Control Hub.
IMPORTANT NOTE: Eventually the Control Hub will need be renamed so that its name complies with Game
Manual rule <RS01.
• Rename one smartphone to "<TEAM NUMBER>-RC" (replace <TEAM NUMBER> with your team
number).
• Install the Robot Controller app onto the Robot Controller phone.
• Rename a second smartphone to "<TEAM NUMBER>-DS" (where <TEAM NUMBER> is replaced by your
team number).
• Install the Driver Station app onto the Driver Station device. Note: the REV Driver Hub has pre-installed
software.
• Put your phones into Airplane Mode (with the WiFi radios still on).
• Pair (i.e., wirelessly connect) the Driver Station to the Robot Controller.
If, for example, a team has a team number of 9999 and the team has multiple sets of phones, the team might
decide to name one phone “9999-C-RC” for the Robot Controller and the other phone “9999-C-DS” for the Driver
Station. The “-C” indicates that these devices belong to the third set of phones for this team.
Renaming Your Smartphone
(Time Needed to Complete Task: 5 Minutes per Device)
Step 1:
Select Settings icon to display the Android
Settings screen.
Step 2:
Select Wi-Fi to launch the Wi-Fi screen.
Step 3:
Touch the three vertical dots in upper right-
hand corner to display a pop-up menu.
Step 4:
Select Advanced from the pop-up menu.
Step 5:
Select Wi-Fi Direct from the Advanced WiFi
screen.
Step 6:
Touch the three vertical dots to display the
pop-up menu.
Step 7:
Select Configure Device from the pop-up
menu.
Step 8:
Use touch pad to enter the new name of
device. If the device will be a Robot
Controller, specify
your team number and "-RC".
If the device will be a Driver Station, specify
your team number and "-DS".
As of 2021, the FTC apps (v 6.1 and higher) are not available on Google Play. The REV Hardware Client
software will allow you to download the apps to FTC devices: REV Control Hub, REV Expansion Hub, REV
Driver Hub, FTC-approved android devices. Here are some of the benefits:
• Connect a REV Control Hub via WiFi.
• One Click update of all software on connected devices.
• Pre-download software updates without a connected device.
• Back up and restore user data from Control Hub.
• Install and switch between DS and RC applications on Android Devices.
• Access the Robot Control Console on the Control Hub.
The FTC app releases are available on the FTCRobotController Github.
NOTE: it will take an estimated 7.5 minutes per device to complete this task.
Step Image
NOTE: It will take an estimated 2.5 minutes per phone to complete this task. Also note, that the screens
displayed on your Android devices might differ slightly from the images contained in this wiki.
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
26 | FIRST® Tech Challenge Blocks Programming Manual
Step 2:
Placing the phone into Airplane mode will
turn off the Wi-Fi radio. If the Wi-Fi icon has
a diagonal line through it (see Step 1 above),
then the Wi-Fi radio is disabled.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 27
The REV Robotics Control Hub should come with the Robot Controller app pre-installed. Once you have
successfully installed the FTC Driver Station on an Android phone or have powered up the Rev Driver Hub with
the pre-installed app, you will want to establish a secure wireless connection between the Control Hub and the
Driver Station. This connection will allow your Driver Station phone to select op modes on your Robot
Controller and send gamepad input to these programs. Likewise, it will allow your op modes running on your
Robot Controller to send telemetry data to your Driver Station device where it can be displayed for your drivers.
The process to connect the two devices is known as “pairing.”
NOTE: Control Hub does not have its own internal battery. Before you can connect a Driver Station to the
Control Hub, you must connect the Control Hub to a 12V battery.
Step 1:
Step 2:
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
28 | FIRST® Tech Challenge Blocks Programming Manual
Step 3:
Step 4:
Step 5:
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 29
Step 6:
Step 7:
Step 8:
Step 9:
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
30 | FIRST® Tech Challenge Blocks Programming Manual
Step 10:
Step 11:
Step 12:
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 31
Step 13:
Important Note: If your Driver Station was previously paired to a Control Hub, and you
currently would like to connect to an Android smartphone Robot Controller, then before
attempting to pair to the Robot Controller, you should forget the Wi-Fi network for the previous
Control Hub (using the Android Wifi Settings screen on the Driver Station) and then power
cycle the Driver Station device. If the previous Control Hub is powered on and if you haven't
forgotten this network, then the Driver Station might try and connect to the Control Hub and
might be unable to connect to the Robot Controller smartphone.
Once you have successfully installed the FTC apps onto your Android phones, you will want
to establish a secure wireless connection between the two devices. This connection will allow
your Driver Station phone to select op modes on your Robot Controller phone and send
gamepad input to these programs. Likewise, it will allow your op modes running on your
Robot Controller phone to send telemetry data to your Driver Station phone where it can be
displayed for your drivers. The process to connect the two phones is known as “pairing.”
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
32 | FIRST® Tech Challenge Blocks Programming Manual
Pairing the Driver Station to the Robot Controller: Expansion Hub Users
(Time Needed to Complete Task: 10 minutes)
Step 1:
On the main Robot Controller smartphone, select
the FTC Robot Controller icon to open the app.
Step 2:
Verify that the Robot Controller app is running.
The Robot Status field should read “running” if it is
working properly.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 33
Step 3:
On your Driver Station device, find the FTC
Driver Station icon. Tap on the icon to
launch the Driver Station app.
Step 4:
Touch the three vertical dots on the upper
right-hand corner of the main screen of the
FTC Driver Station app. This will launch a
pop-up menu.
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
34 | FIRST® Tech Challenge Blocks Programming Manual
Step 5:
Select Settings from the pop-up menu.
Step 6:
From the Settings screen, select Connect
with Robot Controller to launch the Connect
with Robot Controller screen.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 35
Step 7:
Find the name of your Robot Controller from
the list and select it.
Step 8:
When the Driver Station returns to its main
screen, the first time you attempt to connect
to the Robot Controller a prompt should
appear on the Robot Controller screen.
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
36 | FIRST® Tech Challenge Blocks Programming Manual
Step 9:
Verify that the Driver Station screen has
changed and that it now indicates that it is
connected to the Robot Controller.
Step 10:
Verify that the Robot Controller screen has
changed and that it now indicates that it is
connected to the Driver Station.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 37
This section explains how to connect a motor, a servo, and some sensors to your REV Robotics Control Hub
or REV Robotics Expansion Hub. While the Control Hub differs from the Expansion Hub because of its built-in
Android device, the layout of the external motor, servo, and sensor ports are identical.
The images in this section use an Expansion Hub to demonstrate how to connect the devices. The process,
however, is identical for a Control Hub. When the instructions in this section use the word "Hub", they are
referring to a Control Hub or Expansion Hub.
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
38 | FIRST® Tech Challenge Blocks Programming Manual
Step 3:
Verify that the switch is
in the OFF position.
Step 4:
Connect the 12V
battery to the Tamiya to
XT30 cable.
Step 5:
Turn on the switch and
verify that the Hub is
drawing power from the
battery.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 39
Step 6:
Turn off the switch and
verify that the
Expansion Hub is off.
For the examples in this document, FIRST recommends that the user build a simple rig to secure the motor in
place and prevent it from moving about during the test runs. The image above shows a Tetrix motor installed in
a rig built with a Tetrix motor mount and some Tetrix C-channels. A gear was mounted on the motor shaft to
make it easier for the user to see the rotation of the shaft.
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
40 | FIRST® Tech Challenge Blocks Programming Manual
Step 2:
Connect the other end of the Anderson to JST VH adapter cable into the motor port labeled
“0” on the Hub.
NOTE: The ground pin is on the left side of the servo port.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 41
Step 2:
Verify that the black ground wire of the servo cable matches the ground pin of the servo port
(which is aligned on the left side of the port).
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
42 | FIRST® Tech Challenge Blocks Programming Manual
Step 2:
Plug the other end of the 4-pin JST PH cable to the I2C port labeled “0” on the Hub.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 43
NOTE: In the case of the REV Robotics Touch Sensor, the device has a connector port for a 4-pin sensor
cable. However, the device only needs to connect to one of the two available digital I/O pins. For the REV
Robotics Touch Sensor, the second digital I/O in the port is the one that gets connected when a standard REV
Robotics 4-pin JST PH cable is used. For the “0-1” port, it is the pin labeled “1” that gets connected through the
4-pin cable. Similarly, for the “2-3” port, it is the pin labeled “3” that gets connected through the 4-pin cable.
Step 2:
Plug the other end of the 4-pin JST PH cable to digital I/O port labeled “0-1” on the Hub.
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
44 | FIRST® Tech Challenge Blocks Programming Manual
Before you can communicate with the motor, servo and sensors that are connected to the Expansion or
Control Hub, you first must create a configuration file on your Robot Controller, so that the Robot Controller will
know what hardware is available on the Hub’s external ports.
Step 2:
Plug the Type B Mini end of the USB
cable into the USB mini port on the
Expansion Hub.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 45
Step 3:
Plug the Type A end of the USB cable
into the OTG adapter.
Step 4:
Verify that your Robot Controller
smartphone is powered on and unlocked.
Plug in the USB Micro OTG adapter into
the OTG port of the Robot Controller
phone.
Step 5:
The first time you connect the Robot
Controller smartphone to the Expansion
Hub, the Android operating system
should prompt you to ask if it is OK to
associate the newly detected USB device
(which is the Expansion Hub) with the
FTC Robot Controller app.
Important Information!
You might be prompted multiple times to
associate the USB hardware with the
FTC Robot Controller. Whenever you are
prompted by your phone with this
message, you should always select the
“Use by default for this USB device”
option and hit the “OK” button to
associate the USB device with the FTC
Robot Controller app.
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
46 | FIRST® Tech Challenge Blocks Programming Manual
If you are using a Control Hub, you do not need to make any additional connections. You simply need to make
sure that the Control Hub is powered on and paired to the Driver Station.
Creating a Configuration File on the Robot Controller using the Driver Station
Step 1:
Touch the three vertical dots in the upper
right-hand corner of the Driver Station.
This will launch a pop-up menu.
Step 2:
Select Configure Robot from the pop-up
menu to display the Configuration screen.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 47
Step 3:
If your Robot Controller does not have
any existing configuration files, the screen
will display a message indicating that you
need to create a file before proceeding.
Step 4:
When the new configuration screen
appears, the Robot Controller app will do
a scan of the serial bus to see what
devices are connected to the Robot
Controller.
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
48 | FIRST® Tech Challenge Blocks Programming Manual
Step 5:
Touch the Portal listing Expansion Hub Portal 1 to display what Expansion Hubs are
connected through this Portal.
Since we only have a single Expansion Hub connected, we should only see a single
Expansion Hub configured Expansion Hub 2
Step 6:
Touch the Expansion Hub listing Expansion Hub 2 to display the Input/Output ports for that
device.
The screen should change and list all the motor, servo and sensor ports that are available on
the selected Expansion Hub.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 49
Important note: At this point, although you have created your configuration file, you have not yet saved its
contents to the Robot Controller. You will save the configuration file in a later step.
Step 2:
Since we installed our motor onto port #0
of the Expansion Hub, use the dropdown
control for port 0 to select the motor type
(Tetrix Motor for this example).
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
50 | FIRST® Tech Challenge Blocks Programming Manual
Step 3:
Specify a name for your motor
(motorTest in this example).
Step 4:
Press the Done button to complete the
motor configuration. The app should
return to the previous screen.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 51
Step 2:
Use the dropdown control to select Servo
as the servo type for port #0.
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
52 | FIRST® Tech Challenge Blocks Programming Manual
Step 3:
Use the touch pad to specify the name of
the servo (“servoTest” for this example)
for port #0.
Step 4:
Press the Done button to complete the
servo configuration. The app should
return to the previous screen.
NOTE: In this tutorial, the word "distance" is used interchangeably with the word "range".
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 53
The Expansion Hub has four independent I2C buses, labeled “0” through “3”. In this
example, since you connected the Color Sensor to the port labeled “0”, it resides on I2C Bus
0.
Step 2:
Look at the I2C Bus 0 screen. There
should already be a sensor configured for
this bus.
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
54 | FIRST® Tech Challenge Blocks Programming Manual
Step 3:
Press the Add button to add another I2C
device to this bus.
Step 4:
Select REV Color/Range Sensor from
the dropdown menu for this new device.
Name this device “sensorColorRange”.
Step 5:
Press the Done button to complete the
I2C sensor configuration. The app should
return to the previous screen.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 55
Step 2:
Use the touch screen to add a Digital
Device for port #1 and name the device
“testTouch”.
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
56 | FIRST® Tech Challenge Blocks Programming Manual
Step 3:
Press the Done button to return to the
previous screen.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 57
Step 2:
Press the Done button again to return to
the highest level in the configuration
screens.
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
58 | FIRST® Tech Challenge Blocks Programming Manual
Step 3:
Press the Save button.
Step 4:
When prompted, specify a configuration
file name using the touchscreen’s keypad
(use “TestConfig” for this example).
Step 5:
Press OK to save your configuration
information using that file name.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 59
Step 6:
After the configuration file has been
saved, touch the Android back-arrow
button to return to the main screen of the
app.
Step 7:
Verify that the configuration file is the
active configuration file on the main Driver
Station screen.
6 Writing an Op Mode
Teams who are participating in FIRST Tech Challenge have a variety of programming tools that they can use
to create their own op modes. Teams can use a visual ("drag and drop") programming tool called the FTC
Blocks Programming Tool to create their op modes. Teams can also use a text-based Java tool known as the
FTC OnBot Java Programming Tool or Google's Android Studio integrated development environment (also
known as an "IDE") to create their op modes.
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
60 | FIRST® Tech Challenge Blocks Programming Manual
Users drag and drop jigsaw-shaped programming blocks onto a design “canvas” and arrange these blocks to
create the program logic for their op mode.
The FTC Blocks Programming Tool is powered by Google’s Blockly software and was developed with support
from Google.
Figure 3 - Users arrange jigsaw-shaped programming blocks to create the logic for their op modes.
The examples in this document use a Windows laptop computer to connect to the Robot Controller. This
Windows laptop computer has a Javascript-enabled web browser (Google Chrome) installed that is used to
access the FTC Blocks Programming Tool.
NOTE: The process used to create and edit an op mode is identical if you are using a Control Hub as your
Robot Controller.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 61
NOTE: If you prefer, you can use an alternate device, such as an Apple Mac laptop, or a Chromebook, instead
of a Windows computer to access the FTC Blocks Programming Tool.
Step 2:
Note that your computer might prompt you
with a security warning during the installation
process. If you are prompted with this
warning, Select the “Run” button to continue
with the installation.
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
62 | FIRST® Tech Challenge Blocks Programming Manual
Before you begin this exercise, please make sure that your Windows laptop has the most current service packs
and system updates from Microsoft installed. 3
Step 2:
The Program & Manage screen displays
important information that you can use to
connect your laptop to the FTC Blocks or
OnBot Java Programming Mode server.
3This example assumes the user has a Windows 10 laptop. If you are not using a Windows laptop, the procedure to connect to the Programming
Mode server will differ. Refer to your device’s documentation for details on how to connect to a Wi-Fi network.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 63
Step 3:
Verify the network name and passphrase
for the Program & Manage wireless
network. Towards the top of the screen,
the name of the Program & Manage
wireless network is displayed. If you are
using an Android smartphone as your
Robot Controller, then the wireless
network name will begin with the phrase
"DIRECT-".
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
64 | FIRST® Tech Challenge Blocks Programming Manual
Step 5:
Look for the wireless network that matches
the name displayed on the Program &
Manage screen.
Step 6:
Once you have found the target network in
the list, select it.
Step 7:
When prompted, provide the network
passphrase (in this example ZU7if0hB)
and press Next to continue.
Step 8:
Once you have successfully established a
wireless connection between your
Windows 10 laptop and your Robot
Controller Android device, the status
should be displayed in the wireless
settings for your laptop.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 65
Step 2:
Verify that your web browser is
connected to the programming
mode server. If it is connected to
the programming mode server
successfully, the Robot Controller
Console should be displayed.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 67
Step 3:
Select the Blocks to navigate to
the main Blocks Programming
screen.
Step 4:
Select Create New Op Mode
from the upper left-hand corner of
the browser window. Specify a
name and OK.
Step 5:
Verify that you created the new op
mode. You should see your newly
created op mode opened for editing in
your web browser’s main screen.
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
68 | FIRST® Tech Challenge Blocks Programming Manual
Figure 4 – Each new op mode includes a set of programming blocks that form the basic structure of the op mode.
In the figure above, the main body of the op mode is defined by the outer purple bracket that has the words “to
runOpMode” at the top. As the help tip indicates, this function is executed when this op mode
(“MyFIRSTOpMode” in this example) is selected from the Driver Station.
It can be helpful to think of an op mode as a list of tasks for the Robot Controller to perform. The Robot
Controller will process this list of tasks sequentially. Users can also use control loops (such as a while loop) to
have the Robot Controller repeat (or iterate) certain tasks within an op mode.
Figure 5 - It can be helpful to think of an op mode as a task list for the Robot Controller. 4
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 69
If you think about an op mode as a list of instructions for the robot, this set of instructions will be executed by
the robot whenever a team member selects the op mode called “MyFIRSTOpMode” from the list of available
op modes for this Robot Controller.
You can hide the help text by selecting the blue question mark (“?”) icon. Let’s look at the flow of this basic op
mode. The blue colored block with the words “Put initialization blocks here” is a comment. Comments are
placed in an op mode for the benefit of the human user. The robot will ignore any comments in an op mode.
Any programming blocks that are placed after the “Put initialization blocks here” comment (and before the “call
MyFIRSTOpMode.waitForStart” block) will be executed when the op mode is first selected by a user at the
Driver Station.
When the Robot Controller reaches the block labeled “call MyFIRSTOpMode.waitForStart” it will stop and wait
until it receives a Start command from the Driver Station. A Start command will not be sent until the user
pushes the Start button on the Driver Station. Any code after the “call MyFIRSTOpMode.waitForStart” block
will get executed after the Start button has been pressed.
Figure 7 – The Robot Controller will stop and wait for a Start command when it reaches this programming block.
Any blocks that are placed after the “Put run blocks here” comment and before the green block labeled “repeat
while call MyFIRSTOpMode.opModeIsActive” will be executed sequentially by the Robot Controller after the
Start button has been pressed.
The green block labeled “repeat while call MyFIRSTOpMode.opModeIsActive” is an iterative or looping control
structure.
This green control block will perform the steps listed under the “do” portion of the block as long as the condition
“call MyFIRSTOpMode.opModeIsActive” is true. What this means is that the statements included in the “do”
portion of the block will repeatedly be executed as long as the op mode “MyFIRSTOpMode” is running. Once
the user presses the Stop button, the “call MyFIRSTOpMode.opModeIsActive” clause is no longer true and the
“repeat while” loop will stop repeating itself.
Important Note: The programming blocks for user configured devices (motors, servos and sensors) will only be
visible in the Blocks tool if there is an active configuration file with the configured devices included in the file. If
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
70 | FIRST® Tech Challenge Blocks Programming Manual
a type of device is not included in the active configuration file, then its programming blocks will be missing from
the palette of blocks.
Step 2:
When prompted, type in a
new variable name: tgtPower.
Step 3:
Once you have created your new
variable, some additional programming
blocks should appear under the
Variables block category.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 71
Step 4:
Select “set tgtPower to” block and
then drag the block under the “Put
loop blocks here” comment block.
Step 5:
Select Gamepad of programming
blocks, then the
“gamepad1.LeftStickY” block from the
list.
Step 6:
Drag the “gamepad1.LeftStickY”
block to the right side of the “set
tgtPower to” block.
Step 7:
Select the Math category for the
programming blocks then the
negative symbol (“- “).
Step 8:
Drag the negative symbol (also
known as a “negation operator”) to
the left of the
“gamepad1.LeftStickY” block.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 73
Step 9:
Select Actuators category of
blocks, then DcMotor.
Step 10:
Select the “set motorTest.Power to
1” programming block.
Step 11:
Drag “set motorTest.Power to 1”
block so that it snaps in place right
below the “set tgtPower to” block.
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
74 | FIRST® Tech Challenge Blocks Programming Manual
Step 12:
Select the Variables, then
“tgtPower” block.
Step 13:
Drag the “tgtPower” block so it
snaps in place just to the right of
the “set motor1.Power to” block.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 75
Step 2:
Drag the “call telemetry.addData(key,
number)” block and place it below the
“set motor1.Power to” block.
Step 3:
Select the Variables then the “tgtPower”
block.
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
76 | FIRST® Tech Challenge Blocks Programming Manual
Step 4:
Repeat this process and
name the new key “Motor
Power”.
Step 5:
Select Actuators, then
DcMotor.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 77
Step 6:
Drag the “motorTest.Power”
block to the “number”
parameter of the second
telemetry block.
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
78 | FIRST® Tech Challenge Blocks Programming Manual
Your op mode requires input from a gamepad and uses this input to control a DC motor. To run your op mode,
you will need to connect a Logitech F310 gamepad to the Driver Station.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 79
Step 2:
Connect the gamepad to the Driver
Station using the Micro USB OTG
adapter cable.
Step 3:
Your example op mode is looking for
input from the gamepad designated as
the user or driver #1.
You should see your recently saved op mode among the list of available op modes that reside
on your Robot Controller.
NOTE: TeleOp is short for Tele-Operated and it implies a driver-controlled op mode (i.e., an
op mode that gets input from a human driver).
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
80 | FIRST® Tech Challenge Blocks Programming Manual
Step 5:
Select MyFIRSTOpMode to load your
op mode on the Robot Controller.
Step 6:
Press INIT to initialize your op mode.
Step 7:
Press Start (designated by the
triangular-shaped symbol) to start the op
mode run.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 81
Step 8:
Use the left joystick of the gamepad to
control the operation of the DC motor.
In this section, you will modify your op mode to control a servo motor with the buttons of the gamepad.
In the figure below, a “standard scale” 180-degree servo is shown. This type of servo is popular with hobbyists
and with FIRST Tech Challenge teams. This servo motor can rotate its shaft through a range of 180 degrees.
Using an electronic module known as a servo controller you can write an op mode that will move a servo motor
to a specific position. Once the motor reaches this target position, it will hold the position, even if external
forces are applied to the shaft of the servo.
Figure 9 – An example of a servo motor that is commonly used on FIRST Tech Challenge robots. 5
Servo motors are useful when you want to do precise movements (for example, sweep an area with a sensor
to look for a target or move the control surfaces on a remotely controlled airplane).
With a typical servo, you can specify a target position for the servo. The servo will turn its motor shaft to move
to the target position, and then maintain that position, even if moderate forces are applied to try and disturb its
position.
For the Program & Manage server, you can specify a target position that ranges from 0 to 1 for a servo. A
target position of 0 corresponds to zero degrees of rotation and a target position of 1 corresponds to 180
degrees of rotation for a typical servo motor.
Figure 10 - A typical servo motor can rotate to and hold a position from 0 to 180 degrees.
In this example, you will use the colored buttons on the right side of the F310 controller to control the position
of the servo. Initially, the op mode will move the servo to the midway position (90 degrees of its 180-degree
range). Pushing the yellow “Y” button will move the servo to the zero-degree position. Pushing the blue “X”
button or the red “B” button will move the servo to the 90-degree position. Pushing the green “A” button will
move the servo to the 180-degree position.
Figure 11 – The colored buttons on the right side of the gamepad will be used to control servo position.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 83
Step 3:
On the left-hand side of the screen
select Actuators and then Servo.
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
84 | FIRST® Tech Challenge Blocks Programming Manual
Step 4:
Select the “set servoTest.Position to”
block from the list of available Servo
blocks.
Step 5:
Drag the “set servoTest.Position to”
block under the comment block “Put
initialization blocks here.”
Step 6:
Select the number block ”0” and
change the block’s value to “0.5”.
Step 7:
Select Logic, then select the “if do”
block from the list of available blocks.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 85
Step 8:
Select the Gamepad and the
“gamepad1.Y” block from the list of
available blocks.
Step 9:
Drag the “gamepad1.Y” block to the
right side of the “if do” block.
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
86 | FIRST® Tech Challenge Blocks Programming Manual
Step 10:
On the left-hand side of the screen
select the category called Actuators,
then Servo.
Step 11:
Select the “set servoTest.Position to”
block from the list of available Servo
blocks.
Step 12:
Drag the “set servoTest.Position to”
block so that it snaps in place in the do
portion of the “if do” block.
Step 13:
Select the blue and white Settings
icon for the “if do” block. This will
display a pop-up menu that lets you
modify the “if do” block.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 87
Step 14:
Drag an “else if” block from the left
side of the pop-up menu and snap it
into place under the “if” block.
Step 15:
Select the Settings icon to hide the
pop-up menu for the “if do” block.
Step 16:
Select Logic then the “and” block
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
88 | FIRST® Tech Challenge Blocks Programming Manual
Step 17:
Drag the “and” block so it clicks in
place as the test condition for the first
“else if” block.
Step 18:
Select the word “and” and select “or”
from the pop-up menu to change the
block to a logical “or” block.
Step 19:
Select the Gamepad and select the
“gamepad1.X” block.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 89
Step 22:
Highlight the number “0” and
change it to “0.5”.
Step 23:
Use a “gamepad1.A” block as
the test condition for the second
“else if” block.
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
90 | FIRST® Tech Challenge Blocks Programming Manual
Step 25:
Save Op Mode and verify that it
was saved successfully to the
Robot Controller.
Step 26:
Following the procedure
outlined in Running Your Op
Mode to run your updated op
mode.
9 Using Sensors
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: 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.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 91
Select the
“MyFIRSTOpMode”
project to open it.
Step 3:
Select Utilities, then
Telemetry.
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
92 | FIRST® Tech Challenge Blocks Programming Manual
Step 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.
Step 5:
Click and highlight the “key”
text and change the text so it
reads “Distance (cm)”.
Step 6:
Select and expand the Sensors category. Select the “REVColor/RangeSensor” subcategory.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 93
Step 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.
Step 8:
Save your op mode and
verify that it was saved
successfully to the Robot
Controller.
Step 9:
Follow the procedure
outlined in the section
Running Your Op Mode to
run your updated op mode.
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
94 | FIRST® Tech Challenge Blocks Programming Manual
The REV Robotics Touch Sensor can be connected to a digital port on the Hub. The Touch Sensor is HIGH
(returns TRUE) when it is not pressed. It is pulled LOW (returns FALSE) when it is pressed.
The 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 the 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 Hub, the Touch Sensor will be
connected to the second pin (labeled “1”) of the port. The first pin (labeled “0”) will stay disconnected.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 95
Step 2:
Verify that MyFIRSTOpMode is
opened for editing.
Step 3:
Select Logic, then the “if do else”
block.
Step 4:
Drag the “if do else” block to the
position before the
“Telemetry.update” block.
Step 5:
Select the Sensors
category to expand it.
Select the Touch
Sensor subcategory,
then find and select the
“.isPressed” block.
Step 6:
Drag the “isPressed”
block to the test
condition of the “if do
else” programming block.
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
96 | FIRST® Tech Challenge Blocks Programming Manual
Step 7:
Select the Utilities
category on the left-hand
side of your browser.
Find and Select the
Telemetry subcategory.
Step 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”.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 97
Step 10:
Save your op mode and verify that it was
saved successfully to the Robot
Controller.
Step 11:
Following the procedure outlined in the
section titled Running Your Op Mode.
10 Troubleshooting
If you are having problems seeing your FTC Blocks Programming Wi-Fi network in your list of available
networks, make sure that your Driver Station is paired and connected to your Robot Controller (see section 3.5
of this document). Also, make sure that your Robot Controller is in Programming Mode (see section 6.4 of this
document). Also, make sure that your Windows 10 device has its most current updates installed from
Microsoft.
If you have verified that the Driver Station is paired and connected to the Robot Controller and that the Robot
Controller is in Programming Mode, and if you have verified that your Windows 10 updates are current, then
you might have to manually connect your Windows 10 computer to the blocks programming mode Wi-Fi
network.
You can manually connect to this network as if the network were a hidden network (i.e., a network that does
not broadcast its presence to other Wi-Fi devices).
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
98 | FIRST® Tech Challenge Blocks Programming Manual
Step 2:
Select the “Hidden Network” listing to
start the connection process. The
listing should display a “Connect”
button.
Step 3:
The computer should prompt you for
the name or SSID of your blocks
programming mode Wi-Fi network.
You should type in the network name
that is displayed in the Programming
Mode window of the Android device.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 99
Step 6:
The computer will attempt to connect
to your network. Note that it could take
several minutes before it connects.
Step 7:
If you could successfully connect to
the network, it will eventually appear in
the list of networks on your computer.
1. Make sure the Driver Station is successfully paired to the Robot Controller (see section for details).
Often the Robot Controller’s Wi-Fi Direct network will time out if it is not connected to the Driver Station.
2. Make sure the Robot Controller has been switched successfully to programming mode (see section 0).
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
100 | FIRST® Tech Challenge Blocks Programming Manual
3. Power cycle (turn off and then turn back on) your Robot Controller phone and then relaunch the FTC
Robot Controller app. Reconnect the Driver Station to the Robot Controller, and then turn off the
wireless adapter on your laptop for a few seconds, and then turn it back on (to force a rescan of the
available Wi-Fi networks).
Figure 13 – If the save attempt fails, you might not be connected to the blocks programming mode network and/or server.
1. Did you remember to save the op mode the last time you edited and then exited the op mode? If you
did not save the op mode after the last editing session, you might have lost some of your changes.
2. Are the blocks collapsed and/or in an area of the design “canvas” (or design pane) that is outside your
current browser window? If so, you can use the expand and cleanup functions of the blocks
programming tool to expand all the blocks on your screen and to organize them in an easy-to-view (and
easy-to-find) manner.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 101
Figure 14 – You can right mouse Select “canvas” and select Expand Blocks to expand all the blocks in your op mode.
Figure 15 – Right mouse Select the canvas/design pane and select Clean up Blocks to organize all your blocks.
3. Are your programming blocks missing and you only see a solitary gray rectangular block on your
screen? If this is the case, then you should check to see if the active configuration file for the Robot
Controller is the same configuration file that you originally used to create the op mode. There is a bug in
early versions of the blocks programming software that prevents the blocks server from properly
rendering the programming blocks if the active configuration of the Robot Controller does not match the
original configuration file used to create the op mode. More specifically, if some of the hardware
devices (such as the DC motors or servos) from the original file are missing from the current
configuration file, the blocks mode server will not properly display the programming blocks in the design
pane.
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
102 | FIRST® Tech Challenge Blocks Programming Manual
Figure 16 – Are the programming blocks missing and only a solitary gray rectangular block is visible?
1. Verify that the Driver Station is properly paired to the Robot Controller.
2. Make sure that the Robot Controller is not in Programming Mode.
3. Check the ping times on the Driver Station main screen. The ping time is the average time it takes for
the Driver Station to send a message to the Robot Controller and for the Robot Controller to
acknowledge that it received the message. If the ping time is low (< 20 msec) the wireless connection
between the Driver Station and Robot Controller is good. If the ping time is consistently high (> 50
msec) there could be some wireless interference in your venue that is causing the problems between
the Driver Station and the Robot Controller.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 103
Figure 17 - A "problem communicating with..." message often indicates a bad connection between the phone and modules.
If you notice this error message, here are some things you can try:
1. Verify that the USB cable connecting the phone to the Expansion Hub is secure and well connected.
2. Verify that the 12V power cables connecting the battery to the switch and the Expansion Hub are
properly secured and connected. Also, verify that the power switch is in the on position.
3. Try to do a “Restart Robot” from the pop-up menu (touch the three vertical dots in the upper right-hand
screen of the Robot Controller or Driver Station apps).
4. If that does not work, disconnect the USB cable from the phone, then shut down the main power switch
on the Expansion Hub. Wait for 5 seconds, then power the device back on and reconnect the USB
cable to the phone.
10.2.6 Additional Disconnect Incidents with Motorola E4, G5 and G5 Plus Phones
We have observed a few incidents where teams who were using newer Motorola phones have had
disconnects similar to the ones described in an earlier Troubleshooting article (see Motorola E4, G5 and G5
Plus Phones Disconnecting Momentarily). These newer Motorola phones have support for 5GHz Wi-Fi
Channels.
What we observed was that these teams saw occasional disconnects, primarily during the autonomous portion
of the match with these 5GHz enabled phones. For these newer Motorola phones, if the phone thinks that the
WiFi radio is not being used, the phone will take control of the radio and scan the available WiFi channels.
When the phone is doing this scanning, the WiFi radio appears to not be available to the FTC app. We do not
know the exact purpose of these scans (the manufacturer will not disclose a reason), but if the system thinks
the radio is available, it will scan the available channels sequentially. We have documented that when these
scans occur with the newer phones (which have the additional 5GHz channels as part of the scan process) the
scans can take a relatively long amount of time to complete (greater than 2 seconds) causing the watchdog
safety mechanism in our apps to kick in. This watchdog mechanism will cause the Robot Controller to go into
an Emergency Stop (E Stop) mode.
Note that the heartbeat messages sent by the Driver Station (and acknowledged by the Robot Controller) do
not seem to suppress this scanning behavior on the Motorola phones. However, telemetry messages sent from
the Robot Controller to the Driver Station do seem to suppress the scanning process.A fix for the FTC apps
has been developed that will address this Motorola scanning issue.
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
104 | FIRST® Tech Challenge Blocks Programming Manual
Teams who experienced these disconnects, even after they modified the wait for start process as described in
the previous Troubleshooting report, seemed to have the disconnects occur during the autonomous portion of
their matches. An inspection of their autonomous op modes revealed that these teams often had linear op
modes with long (greater than 2 seconds) sleep intervals. To work around the Motorola scanning issue, the
teams rewrote their op modes so that if they needed to sleep for a fair amount of time, they would periodically
send telemetry messages from the robot controller while they were sleeping to suppress this scanning
behavior.
For a team that is using an iterative op mode, a telemetry statement can be placed in the loop() method to
suppress the scanning behavior. For a team that is using a linear op mode, a custom sleep method can be
made which will cause the Robot Controller to periodically send telemetry statements and avoid this scanning
behavior.
In the following example Blocks op mode, the op mode uses a custom function called "mySleep" rather than
the standard sleep block when it needs to sleep during its autonomous run.
In this example, the mySleep user-defined function uses a timer to "sleep" the requested amount. However, in
between periodic sleeps, the mySleep function will also send out an occasional telemetry message to suppress
the Motorola WiFi scanning behavior.
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 105
Similarly, if you are using Java to write your op mode, you can call a custom, user-defined sleep method
instead of using the LinearOpMode's sleep method:
motorTest.setPower(0.2);
mySleep(7000, "Motor is running...");
motorTest.setPower(0);
mySleep(3000, "Should be off...");
The Java version of the mySleep method also uses an elapsed timer to send telemetry messages periodically
while sleeping. These telemetry statements should suppress WiFi scanning on the Motorola devices.
If there is a Wi-Fi blocker present, then teams will have trouble connecting their Driver Station devices to their
Robot Controllers whenever they are in the range of the Blocker. The Driver Station might be able to see, for
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”
106 | FIRST® Tech Challenge Blocks Programming Manual
example, the Robot Controller listed as an available device, but it would fail to connect or stay connected to the
Robot Controller in the presence of the Blocker.
A good way to detect a Wi-Fi blocker is to take a pair of the problematic Android devices outside, away from
the school's Wi-Fi system. If the devices can pair outside and stay connected (and can run op modes) outside,
and if these devices suddenly disconnect once you move them back inside, then you might have a Wi-Fi
Blocker present.
NOTE: We have even had an instance of a region that was at a school where they held an event in a prior year
without issue. However, the teams were now having problems connecting their Android devices and it turned
out that the school had installed a Wi-Fi Blocker in between the previous and current events.
If you have confirmed that there is a Wi-Fi Blocker present, then the best course of action is to work with the
venue's IT administrator to disable the Wi-Fi Blocker for the event.
NOTE: FIRST has seen instances where the IT administrators did not even realize this Wi-Fi Blocking
technology was present. It turned out that their wireless access points had this feature built-in, and they had to
modify a configuration file (i.e., modify a "white list") to permit devices with a certain IP address range
(192.x.x.x) to be allowed in their venue.
At some events, FTAs discovered a WiFi Blocker, but did not have an IT admin available to disable it. The
FTAs were able to find the Wi-Fi Blockers in the venue that were located close to the competition field and
unplug them for the duration of their event. The FTAs reported that after the devices were powered off, the
teams were able to pair and control their robots successfully.
NOTE: that the Wi-Fi Event Checklist suggests that an FTA or similar technical volunteer conduct some
preliminary tests in advance of an event to check for things like Wi-Fi Blockers. The best way to deal with a
Blocker is to detect it well in advance of your event.
Also, in the United States of America, the FCC has ruled Wi-Fi Blocking illegal:
Revision 1: 8.12.2021
FIRST® Tech Challenge Blocks Programming Manual | 107
Appendix A – Resources
Anyone may view questions and answers within the FIRST® Tech Challenge game Q&A forum without a
password. To submit a new question, you must have a unique Q&A system user name and password for your
team.
Volunteer Forum
Volunteers can request access to role specific volunteer forums by emailing
[email protected]. You will receive access to the forum thread specific to your role.
FIRST Websites
FIRST homepage – www.firstinspires.org
FIRST Tech Challenge Page – For everything FIRST Tech Challenge.
FIRST Tech Challenge Volunteer Resources – To access public volunteer manuals.
FIRST Tech Challenge Event Schedule – Find FIRST Tech Challenge events in your area.
Feedback
We strive to create support materials that are the best they can be. If you have feedback about this manual, please email
[email protected]. Thank you!
Gracious Professionalism® - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”