Class Device

java.lang.Object
com.cdarobotics.cdalib.devices.Device
Direct Known Subclasses:
AnalogInputDevice, ColorSensorDevice, CRServoDevice, DigitalInputDevice, DistanceSensorDevice, IMUDevice, MotorDevice, NullDevice, RevColorSensorV3Device, ServoDevice, TouchSensorDevice

public abstract class Device extends Object
A hardware wrapper that is refreshed once per loop via update(). Actuator devices cache their commanded state and flush it to hardware in update() (write caching); sensor devices read hardware in update() and cache the value for the rest of the loop.

Devices are typically owned by a DeviceSubsystem, which calls update() automatically every loop.

  • Constructor Details

    • Device

      public Device()
  • Method Details

    • update

      public abstract void update()
      Flush pending writes to, or refresh cached reads from, the underlying hardware.