C# Class BrickPi.Movement.Vehicule

Afficher le fichier Open project: Ellerbach/BrickPi Class Usage Examples

Méthodes publiques

Méthode 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

Méthode 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 méthode

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

Backward() public méthode

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
Résultat void

Foreward() public méthode

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
Résultat void

Forward() public méthode

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

IsRunning() public méthode

Return true if the vehicule is moving
public IsRunning ( ) : bool
Résultat bool

Stop() public méthode

Stop the vehicule
public Stop ( ) : void
Résultat void

TrunLeftTime() public méthode

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
Résultat void

TrunRightTime() public méthode

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
Résultat void

TurnLeft() public méthode

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
Résultat void

TurnRight() public méthode

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
Résultat void

Vehicule() public méthode

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
Résultat System