Class CANSensor

java.lang.Object
lib.custom.CustomCAN
lib.custom.sensors.CANSensor
Direct Known Subclasses:
CANEncoder, CANInfraredDistanceSensor, CANUltrasonicDistanceSensor

public class CANSensor extends CustomCAN
A sensor over CAN
  • Constructor Details

    • CANSensor

      public CANSensor(String name, int id)
      Parameters:
      name - Name of CAN sensor (not really needed)
      id - ID of CAN sensor (0x600 to 0x700, must correspond to a Teensy or similar)
  • Method Details

    • getSensorStatuses

      public static String[] getSensorStatuses()
    • readSensor

      public int[] readSensor() throws InvalidSensorException
      Read the pair of ints from a CAN sensor
      Returns:
      The latest pair of integers from the sensor
      Throws:
      InvalidSensorException - If the available data is more than one tenth of a second old, this function will throw an InvalidSensorException to indicate that.