.Stop( )

back to FEHMotor

Description

This function allows the user to stop a motor. This statement is functionally equivalent to using the using the command .SetPercent(0). Please note that while this command is called stop, it will not physically apply any sort of braking to the motors. Momentum effects from the robot will cause the motors to continue to spin for a short time.

Parameters

None.

Returns

None.

Examples

#include <FEHMotor.h>
//need FEHUtility.h for Sleep()
#include <FEHUtility.h>

int main(void)
{
    //declares a motor on motor port 0
    FEHMotor right_motor(FEHMotor::Motor0, 9.0); 

    //set motor to full speed for 5 seconds
    right_motor.SetPercent( 100. );
    Sleep(5.);

    //turn motor off
    right_motor.Stop();
}