You are on page 1of 10

Green Army Robotics Team 2866

What is IR?

The Equipment

FTC uses two pieces of equipment for IR:


1200 Hz Hi-Technic IR Beacon Emits a 1200 Hz infrared signal that can be detected with a sensor NXT IR Seeker V2 Detects the strength and direction of any IR signals within 240 degrees in front of it

Mounting the Equipment


The IR beacon will be stationary during the match, hanging from a randomly IR BEACON selected peg on the rack The IR sensor should be mounted securely on the robot, facing the proper direction with no obstructions to block the signal. It should be plugged into one of the sensor ports (1-4).

How the Sensor Works


5 mini internal IR detectors 9 detection zones

Programming the Sensor


Sensor Value: 1-9 (based on signal strength) No signal: outputs 0. Shows strength of signal depending on proximity.

Setting Up the Pragma


Go to Robot->Motors & Sensors Setup ->Sensors Find the port that the sensor is plugged into, and under Type select I2C Custom. Name the sensor something logical Click Apply and close the window

The Drivers
To use the IR sensor, you will need to download the latest RobotC 3rd Party Driver Suite (3.0) from botbench.com, if you havent already. For the V1 sensor, the driver is called hitechnic-irseeker-v1.h For the V2 sensor, the driver is called hitechnic-irseeker-v2.h

Reading the Sensor

The easiest way to read the IR sensor is to create a function that takes the data from the sensor (outputted by the function HTIRS2readACDir(irSensor) within the driver) and returns it as an integer 1-9. You can then simply call this function to read the sensor.

Example Code

You might also like