Bring Up: CANifier

Phoenix Tuner

Using Self-test Snapshot, confirm all sensor inputs required by the robot application.

If using Limit switches, assert each switch one at time. Self-test Snapshot after each transition to confirm wiring.

If using Quadrature or Pulse width sensor, rotate sensor while performing Self-test Snapshot to confirm sensor values.

_images/bring-15.png

Tip

There is a modernized version called Tuner X that is available for Windows and Android devices (works with Phoenix 5 and Phoenix Pro).

LED Strip Control

See CANifier user’s guide for wiring and controlling LED Strip.

CANifier API

Create a CANifier object in your robot application and poll whatever sensor you have connected to it or the bus voltage

import com.ctre.phoenix.CANifier;
public class Robot extends TimedRobot {
    CANifier _canifier = new CANifier(0);
    int _loopCount = 0;

    public void teleopPeriodic() {
        if(_loopCount++ > 10)
        {
            _loopCount = 0;
            System.out.println("Bus voltage is: " + _canifier.getBusVoltage());
        }
    }
_images/canifier-lv-1.png

Confirm output matches Self-test Snapshot results.