C# Класс BrickPi.Movement.Vehicule

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

Backward() публичный Метод

Run backward at the specified speed
public Backward ( int speed ) : void
speed int speed is between -255 and +255
Результат void

Backward() публичный Метод

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
Результат void

Foreward() публичный Метод

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
Результат void

Forward() публичный Метод

Run forward at the specified speed
public Forward ( int speed ) : void
speed int speed is between -255 and +255
Результат void

IsRunning() публичный Метод

Return true if the vehicule is moving
public IsRunning ( ) : bool
Результат bool

Stop() публичный Метод

Stop the vehicule
public Stop ( ) : void
Результат void

TrunLeftTime() публичный Метод

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
Результат void

TrunRightTime() публичный Метод

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
Результат void

TurnLeft() публичный Метод

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
Результат void

TurnRight() публичный Метод

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
Результат void

Vehicule() публичный Метод

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
Результат System