CuttleRevHub

open class CuttleRevHub : LynxCommExceptionHandler, RobotArmingStateNotifier.Callback

Object that represents a Rev Robotics Control or Expansion hub. This is the basis of the Cuttlefish device architecture.

Constructors

Link copied to clipboard
constructor(hardwareMap: HardwareMap, hubName: String)
Create Rev hub object using the name of the hub (this can be found in the robot config).
constructor(hardwareMap: HardwareMap, hubType: CuttleRevHub.HubTypes)
Create Rev hub object using using HubTypes enum.

Types

Link copied to clipboard
Link copied to clipboard
I2C Channel Speeds Standard: up to 100 Kb/s Fast: up to 400 Kb/s Fast Plus: up to 1 Mb/s High Speed: up to 3.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var revHub: LynxModule
Link copied to clipboard

Functions

Link copied to clipboard
open fun blinkColor(r: Int, g: Int, b: Int)
Make the LED on the hub blink a certain color
Link copied to clipboard
open fun enableServoPWM(port: Int, enable: Boolean)
Enable/disable the signal being sent to a servo
Link copied to clipboard
open fun getAnalog(port: Int): CuttleAnalog
Return a analog sensor with port and hub set
Link copied to clipboard
open fun getAnalogEncoder(port: Int, offset: Double, voltage: Double): CuttleAnalogEncoder
Return a configured analog encoder
Link copied to clipboard
Get the current being drawn by the hub WARNING: This will poll the hub costing an extra 3ms
Link copied to clipboard
Get the voltage of the battery WARNING: This will poll the hub costing an extra 3ms
Link copied to clipboard
open fun getDigital(port: Int): CuttleDigital
Return a digital sensor with port and hub set
Link copied to clipboard
open fun getEncoder(port: Int, counts: Double): CuttleEncoder
Return an encoder with port counts, and hub set
Link copied to clipboard
open fun getMotor(port: Int): CuttleMotor
Return a motor with port and hub set
Link copied to clipboard
open fun getMotorCurrent(port: Int): Int
Returns the current being drawn by a motor
Link copied to clipboard
open fun getServo(port: Int): CuttleServo
Return a configured servo by port
Link copied to clipboard
open fun onModuleStateChange(module: RobotArmingStateNotifier, state: RobotArmingStateNotifier.ARMINGSTATE)
Link copied to clipboard
open fun pullBulkData()
Pull bulk data from the hub.
Link copied to clipboard
open fun rainbow()
Set the blink pattern of the LED on the hub to a rainbow
Link copied to clipboard
open fun sendCommand(message: LynxRespondable): Boolean
Send command to the hub (If response needed, use sendCommandReceiveSync)
Link copied to clipboard
open fun sendCommandReceiveSync(message: LynxDekaInterfaceCommand): LynxMessage
open fun sendCommandReceiveSync(message: LynxStandardCommand): LynxMessage
Send command to the hub and returns response (If no response needed, use sendCommand)
Link copied to clipboard
Set the speed of all I2C channels.
Set speed of a specific I2C channel.
Link copied to clipboard
open fun setLedColor(r: Byte, g: Byte, b: Byte)
Set the color of the LED on the hub
Link copied to clipboard
open fun setMotorPower(port: Int, power: Double)
Set the power of a motor
Link copied to clipboard
open fun setMotorZeroPowerBehaviour(port: Int, behavior: DcMotor.ZeroPowerBehavior)
Set the zero power behaviour of the motor
Link copied to clipboard
open fun setServoPosition(port: Int, position: Double)
Set the position of a servo
Link copied to clipboard
open fun setServoPWM(port: Int)
Link copied to clipboard
open fun smoothRainbow()
Set the blink pattern of the LED to a 16-step rainbow