AndyMark FRC CAN API (C++) v2027.0.2_alpha5
Loading...
Searching...
No Matches
CAN_Koors40 Class Reference

Motor controller device (Koors40). More...

#include <AM_CAN_Koors40.h>

Inheritance diagram for CAN_Koors40:
CanDevice

Public Member Functions

 CAN_Koors40 (int busId, int deviceID)
 Construct a Koors40 device with the given CAN bus and CAN ID.
void setSpeed (int speed)
 Command the motor with a percentage output.
void setBrakeMode ()
 Put the controller in brake (coast disabled) mode.
void setCoastMode ()
 Put the controller in coast (brake disabled) mode.
Public Member Functions inherited from CanDevice
 CanDevice (int busId, int deviceID, int deviceManufacturer, int deviceType)
 Construct a CAN device wrapper.
virtual ~CanDevice ()=default
 Virtual destructor.
int getDeviceId ()
 Get this device's configured CAN ID.
void RestartDevice ()
 Request a device reboot via CAN command.

Additional Inherited Members

Protected Member Functions inherited from CanDevice
void SendCANMessage (int apiID, const uint8_t *data, int length)
 Low-level helper to transmit a CAN packet.
bool ReceiveCANMessage (int apiID, HAL_CANReceiveMessage *data, int timeoutMs)
 Receive a packet with a specific API ID, optionally waiting up to timeout.
Protected Attributes inherited from CanDevice
wpi::CAN m_can
int m_busId
int m_deviceID
int deviceManufacturer
int deviceType

Detailed Description

Motor controller device (Koors40).

Constructor & Destructor Documentation

◆ CAN_Koors40()

CAN_Koors40::CAN_Koors40 ( int busId,
int deviceID )
explicit

Construct a Koors40 device with the given CAN bus and CAN ID.

Parameters
busIdThe selected CAN bus number.
deviceIDThe device's CAN ID.

Member Function Documentation

◆ setBrakeMode()

void CAN_Koors40::setBrakeMode ( )

Put the controller in brake (coast disabled) mode.

◆ setCoastMode()

void CAN_Koors40::setCoastMode ( )

Put the controller in coast (brake disabled) mode.

◆ setSpeed()

void CAN_Koors40::setSpeed ( int speed)

Command the motor with a percentage output.

Parameters
speedDesired output in percent [-100..100]. Values are clamped.

The documentation for this class was generated from the following file: