Class org.bluemelon.bluesense.MotorDevice

Description

Class for communicating with a motor driver device.

Method Index

new MotorDevice()
requestSetSpeed(), requestSetSpeeds()

Inherited from Device

Constructor Detail

MotorDevice

function MotorDevice(master:Master, deviceId:Number)

This constructor creates a new object for communicating with a motor driver device.

Parameters

mastercontains a pointer to the master object, see Master.
deviceIdis the unique device identifier which you can find on the board or using the Master.requestDeviceTable method of the Master.

Method Detail

requestSetSpeeds

function requestSetSpeeds(speed1:Number, speed2:Number)

Change the speed of both motors at once

Parameters

speed1specifies the speed of motor 1, it should be between -127 to 127, negative means turning backwards.
speed2specifies the speed of motor 2, it should be between -127 to 127, negative means turning backwards.

requestSetSpeed

function requestSetSpeed(port:Number, speed:Number)

Change the speed of one of the motors

Parameters

portspecifies the port of which the pulse width has to be changed, valid are 1 through 8.
speedspecifies the speed, it should be between -127 to 127, negative means turning backwards.