UMRT Arm Firmware Library
Enumerations
SYSEX_COMMANDS.hpp File Reference

Defines the SysexCommands enum which lists the commands which are available to send a Stepper Controller over Firmata. More...

#include <stdint.h>
Include dependency graph for SYSEX_COMMANDS.hpp:

Go to the source code of this file.

Enumerations

enum  SysexCommands : uint8_t {
  ARDUINO_ECHO = 0x00 , SET_SPEED = 0x01 , GET_SPEED = 0x02 , SEND_STEP = 0x03 ,
  SEEK_POS = 0x04 , GET_POS = 0x05 , SET_GRIPPER = 0x06
}
 Lists the command IDs and associated requirements which can be sent over Firmata to a Stepper Controller. More...
 

Detailed Description

Defines the SysexCommands enum which lists the commands which are available to send a Stepper Controller over Firmata.

Enumeration Type Documentation

◆ SysexCommands

enum SysexCommands : uint8_t

Lists the command IDs and associated requirements which can be sent over Firmata to a Stepper Controller.

Enumerator
ARDUINO_ECHO 

Respond back with the payload.

Parameters
payloada byte array of any length
Returns
payload exactly as it was received
SET_SPEED 

Sets the speed of a motor.

Parameters
motor_id[uint8_t] the ID of the motor to control
speed[int16_t] the signed speed to set the motor to, in 1/10 RPM
Returns
[uint8_t] motor_id,
[int16_t] speed
GET_SPEED 

Gets the current speed of a motor.

Parameters
motor_id[uint8_t] the ID of the motor to query
Returns
[uint8_t] motor_id,
[int16_t] speed
SEND_STEP 

Moves a motor a specific number of steps.

Direction is controlled by the sign of the speed.

Parameters
motor_id[uint8_t] the ID of the motor to control
num_steps[uint16_t] the number of steps to move
speed[int16_t] the signed target speed to move the motor at, in 1/10 RPM
Returns
[uint8_t] motor_id,
[uint16_t] num_steps,
[int16_t] speed
SEEK_POS 

Moves a motor to a specific step position.

The motor will be moved until GET_POS reflects the requested position. Since this command seeks a position, the sign of the speed is ignored.

Parameters
motor_id[uint8_t] the ID of the motor to control
position[int32_t] the target position in number of steps from the motor's zero point
speed[int16_t] the signed target speed to move the motor at, in 1/10 RPM
Returns
[uint8_t] motor_id,
[int32_t] position,
[int16_t] speed
GET_POS 

Gets the current number of steps from the zero point for a motor.

Parameters
motor_id[uint8_t] the ID of the motor to query
Returns
[uint8_t] motor_id,
[int32_t] position,
SET_GRIPPER 

Sets the target position of the gripper servo.

The servo is controlled such that [0, 180] maps the entire servo range, meaning that a position of 180 may correspond to 90°, 180°, 270°, etc. based on the particular servo attached. Values greater than 180 are ignored.

Parameters
position[uint8_t] the position of the servo, where [0, 180] maps the entire servo range
Returns
[uint8_t] position