Cobra

The Cobra Line Follower provides an array of IR reflective sensors to be used for detecting a line.

Cobra V2

../../_images/cobra-1.svg

Cobra V2 Specifications (Click to Open)
Cobra V2 Specs

Function

Min

Typical

Max

Input Voltage

3.3VDC

5VDC

Current

25mA

70mA

100mA

Sensing Distance

1mm

3mm

5mm

Note

The Cobra V2 requires the Analog Module to send data to the VMX. It is possible to place the inputs directly on the analog pins of the VMX. However, the analog module is recommended.

Analog Module
../../_images/ADC-Module.svg

Cobra V3

The Cobra V3 has an upgraded IR sensor and the ADC has been added to the sensor. There are two outputs on V3, i2c and raw. The i2c connection, connects to the ADC and will return an accurate 12-bit value. Wheras, the raw outputs the raw analog output of the sensor.

../../_images/CobraV3.svg

Cobra V3 Specifications
Cobra V3 Specs

Function

Min

Typical

Max

Input Voltage

3.3VDC

5VDC

Current

25mA

200mA

250mA

Sensing Distance

0mm

5mm

20mm

Programming

Using WPILib:

 1//import
 2import com.studica.frc.Cobra;
 3
 4//Cobra Library
 5private Cobra cobra;
 6
 7//Custruct and instance
 8cobra = new Cobra();
 9
10//or if sensor is using 3.3V
11cobra = new Cobra(3.3F);
12
13//Grab data
14cobra.getVoltage(channel); // returns a float of the voltage
15cobra.getRawValue(channel); // returns a double

The accessor methods will output either the votlage (0 - VIN) or the raw ADC value (0 - 2047).