# Motor - OSC
[OSC]

Control DC motors with the Application Board via OSC. More...

Control DC motors with the Application Board via OSC.

## Devices

There are 4 DC Motor controllers available on the Application Board, numbered 0 - 3.

Each motor controller is composed of 2 adjacent Digital Outs on the Make Application Board:

- motor 0 - Digital Outs 0 and 1.
- motor 1 - Digital Outs 2 and 3.
- motor 2 - Digital Outs 4 and 5.
- motor 3 - Digital Outs 6 and 7.

## Properties

Each motor controller has three properties:

- speed
- direction
- active

Speed
  The speed property corresponds to the speed at which a motor is being driven. This value can be both read and written. The range of values expected by the board is from 0 - 1023. A speed of 0 means the motor is stopped, and 1023 means it is being driven at full speed.

  To set the second motor (connected to Digital Outs 2 and 3) at half speed, send the message

      /motor/1/speed 512

  Leave the argument value off to read the speed of the motor:

      /motor/1/speed

Direction
  The direction property corresponds to the forward/reverse direction of the motor. This value can be both read and written, and the range of values expected is simply 0 or 1. 1 means forward and 0 means reverse.

  For example, to set the first motor to move in reverse, send the message

      /motor/0/direction 0

  Simply change the argument of 0 to a 1 in order to set the motor's direction to forward.

Active
  The active property corresponds to the active state of the motor. If the motor is set to be active, no other tasks will be able to use its 2 digital out lines. If you're not seeing appropriate responses to your messages to the motor, check the whether it's locked by sending a message like

      /motor/0/active

  If you're no longer using the motor, you can free the 2 Digital Outs by sending the message

      /motor/0/active 0