FtSwarmEncoderMotor

The encoder motor is more than a powerful motor: there is a encoder inside to get the rotary motion as well. In a future version of the firmware, you will be able to connect the encoder to an input to know all about the rotary. But for now, you're limited to use it as a normal tractor motor.
Encoder Motor (186175)

Please check out the details about speed, coast & brake in the motor overview, too.

FtSwarmEncoderMotor(FtSwarmSerialNumber_t serialNumber, FtSwarmPort_t port)

Constructor to create a FtSwarmEncoderMotor object. If the referenced controller isn’t connected to the swarm yet, the firmware will waits until the controller gets online.

  • serialNumber: Serial number of the used ftSwarm controller.
  • port: FTSWARM_M1 or FTSWARM_M2

FtSwarmEncoderMotor( const char *name )

Constructor to create a FtSwarmEncoderMotor object. If the referenced controller isn’t connected to the swarm yet, the firmware will waits until the controller gets online.

  • name: Alias name of the IO port.

void setSpeed( int16_t speed )

Sets the motors speed.

  • speed: speed value in the range from -256 to 256.

uint16_t getSpeed()

Returns the motor’s speed.

void setMotionType( FtSwarmMotion_t motionType )

This function sets the motor driver’s operating mode:

  • FTSWARM_COAST the motor is stopped but can be adjusted manually.
  • FTSWARM_BRAKE the motor is stopped but actively braked. The motor cannot be adjusted manually.
  • FTSWARM_ON switches the power stage on again at the original speed.

FtSwarmMotion_t getMotionType()

Returns the motor’s motion type;

void coast( void )

Set the motor’s motion type to FTSWARM_COAST.

void brake( void )

Set the motor’s motion type to FTSWARM_BRAKE.