SharpIR
- class wpilib.SharpIR(channel: SupportsInt | SupportsIndex, a: SupportsFloat | SupportsIndex, b: SupportsFloat | SupportsIndex, min: wpimath.units.meters, max: wpimath.units.meters)
Bases:
SendableManually construct a SharpIR object. The distance is computed using this formula: A*v ^ B. Prefer to use one of the static factories to create this device instead.
- Parameters:
channel – Analog input channel the sensor is connected to
a – Constant A
b – Constant B
min – Minimum distance to report
max – Maximum distance to report
- static GP2Y0A02YK0F(channel: SupportsInt | SupportsIndex) → wpilib._wpilib.SharpIR
Sharp GP2Y0A02YK0F is an analog IR sensor capable of measuring distances from 20cm to 150cm.
- Parameters:
channel – Analog input channel the sensor is connected to
- Returns:
sensor object
- static GP2Y0A21YK0F(channel: SupportsInt | SupportsIndex) → wpilib._wpilib.SharpIR
Sharp GP2Y0A21YK0F is an analog IR sensor capable of measuring distances from 10cm to 80cm.
- Parameters:
channel – Analog input channel the sensor is connected to
- Returns:
sensor object
- static GP2Y0A41SK0F(channel: SupportsInt | SupportsIndex) → wpilib._wpilib.SharpIR
Sharp GP2Y0A41SK0F is an analog IR sensor capable of measuring distances from 4cm to 30cm.
- Parameters:
channel – Analog input channel the sensor is connected to
- Returns:
sensor object
- static GP2Y0A51SK0F(channel: SupportsInt | SupportsIndex) → wpilib._wpilib.SharpIR
Sharp GP2Y0A51SK0F is an analog IR sensor capable of measuring distances from 2cm to 15cm.
- Parameters:
channel – Analog input channel the sensor is connected to
- Returns:
sensor object
- getChannel() → int
Get the analog input channel number.
- Returns:
analog input channel
- getRange() → wpimath.units.meters
Get the range from the distance sensor.
- Returns:
range of the target returned by the sensor
- initSendable(builder: wpiutil._wpiutil.SendableBuilder) → None