C# Class BrickPi.Movement.Vehicule

Datei anzeigen Open project: Ellerbach/BrickPi Class Usage Examples

Public Methods

Method Description
Backward ( int speed ) : void

Run backward at the specified speed

Backward ( int speed, int timeout ) : void

Run backward for the specified number of milliseconds

Foreward ( int speed, int timeout ) : void

Run forward for the specified number of milliseconds

Forward ( int speed ) : void

Run forward at the specified speed

IsRunning ( ) : bool

Return true if the vehicule is moving

Stop ( ) : void

Stop the vehicule

TrunLeftTime ( int speed, int timeout ) : void

Turn the vehicule left for a number of milliseconds

TrunRightTime ( int speed, int timeout ) : void

Turn the vehicule right for a number of milliseconds

TurnLeft ( int speed, int degrees ) : void

Turn the vehicule left by the specified number of degrees for each motor. So 360 will do 1 motor turn. You need to do some math to have the actual vehicule turning fully at 360. It depends of the reduction used.

TurnRight ( int speed, int degrees ) : void

Turn the vehicule right by the specified number of degrees for each motor. So 360 will do 1 motor turn. You need to do some math to have the actual vehicule turning fully at 360. It depends of the reduction used.

Vehicule ( BrickPortMotor left, BrickPortMotor right ) : System

Create a vehicule with 2 motors, one left and one right

Private Methods

Method Description
IsRunning ( BrickPortMotor port ) : bool
RunMotorSyncDegrees ( BrickPortMotor ports, int speeds, int degrees ) : Task
RunMotorSyncTime ( BrickPortMotor ports, int speeds, int timeout ) : Task
RunUntil ( object state ) : void
StartMotor ( int port, int speed ) : void
StopMotor ( int port ) : void

Method Details

Backward() public method

Run backward at the specified speed
public Backward ( int speed ) : void
speed int speed is between -255 and +255
return void

Backward() public method

Run backward for the specified number of milliseconds
public Backward ( int speed, int timeout ) : void
speed int speed is between -255 and +255
timeout int >number of milliseconds to run the motors
return void

Foreward() public method

Run forward for the specified number of milliseconds
public Foreward ( int speed, int timeout ) : void
speed int speed is between -255 and +255
timeout int >number of milliseconds to run the motors
return void

Forward() public method

Run forward at the specified speed
public Forward ( int speed ) : void
speed int speed is between -255 and +255
return void

IsRunning() public method

Return true if the vehicule is moving
public IsRunning ( ) : bool
return bool

Stop() public method

Stop the vehicule
public Stop ( ) : void
return void

TrunLeftTime() public method

Turn the vehicule left for a number of milliseconds
public TrunLeftTime ( int speed, int timeout ) : void
speed int speed is between -255 and +255
timeout int number of milliseconds to run the motors
return void

TrunRightTime() public method

Turn the vehicule right for a number of milliseconds
public TrunRightTime ( int speed, int timeout ) : void
speed int speed is between -255 and +255
timeout int number of milliseconds to run the motors
return void

TurnLeft() public method

Turn the vehicule left by the specified number of degrees for each motor. So 360 will do 1 motor turn. You need to do some math to have the actual vehicule turning fully at 360. It depends of the reduction used.
public TurnLeft ( int speed, int degrees ) : void
speed int speed is between -255 and +255
degrees int degrees to turn each motor
return void

TurnRight() public method

Turn the vehicule right by the specified number of degrees for each motor. So 360 will do 1 motor turn. You need to do some math to have the actual vehicule turning fully at 360. It depends of the reduction used.
public TurnRight ( int speed, int degrees ) : void
speed int speed is between -255 and +255
degrees int degrees to turn each motor
return void

Vehicule() public method

Create a vehicule with 2 motors, one left and one right
public Vehicule ( BrickPortMotor left, BrickPortMotor right ) : System
left BrickPortMotor Motor port for left motor
right BrickPortMotor Motor port for right motor
return System