servo docs
This commit is contained in:
48
640.md
48
640.md
@@ -3,7 +3,15 @@
|
|||||||
The 640 board is used to drive up to 6 DC motors and 2 Servo motors.
|
The 640 board is used to drive up to 6 DC motors and 2 Servo motors.
|
||||||
|
|
||||||
## Getting started
|
## Getting started
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Welcome to the 640 board - this guide will describe all the features of the 640 board and show you how to control up to 6 motors or 3 stepper motors very simply.
|
||||||
|
|
||||||
## Board layout
|
## Board layout
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
### Attaching the power
|
### Attaching the power
|
||||||
### Attaching a Servo
|
### Attaching a Servo
|
||||||
@@ -179,10 +187,48 @@ m1.setMotorSpeed(1250)
|
|||||||
|
|
||||||
#### Select a Servo
|
#### Select a Servo
|
||||||
|
|
||||||
There are two servo ports on the 640 board
|
There are two servo ports on the 640 board. They are numbered 1 and 2 with number 1 to the left hand side and number 2 the closest to the motor ports.
|
||||||
|
|
||||||
|
You select a servo in the same manner as you select motors, by requesting a servo object from the controller - to select the first servo we use:
|
||||||
|
|
||||||
|
``` python
|
||||||
|
s1 = dw.getServo(1)
|
||||||
|
```
|
||||||
|
|
||||||
#### Servo control
|
#### Servo control
|
||||||
|
|
||||||
|
Once you have a servo object there are currently three commands you can run.
|
||||||
|
|
||||||
|
##### off()
|
||||||
|
|
||||||
|
The off command will switch off your servo and stop any signals being sent to it.
|
||||||
|
|
||||||
|
``` python
|
||||||
|
s1.off()
|
||||||
|
```
|
||||||
|
|
||||||
|
##### setPWMuS( *microseconds* )
|
||||||
|
|
||||||
|
This command will allow you to set the PWM pulse to the Servo in microseconds.
|
||||||
|
|
||||||
|
Most standard servos use a parameter value of 1000 for fully counter-clockwise, 2000 for fully clockwise, and 1500 for the middle - though you may have a wider range on your servo, so you should check the technical documentation for it to get the finer details.
|
||||||
|
|
||||||
|
``` python
|
||||||
|
s1.setPWMuS(1500) # middle
|
||||||
|
s1.setPWMuS(2000) # fully clockwise
|
||||||
|
s1.setPWMuS(1000) # fully counter clockwise
|
||||||
|
```
|
||||||
|
|
||||||
|
##### setPWMmS( *milliseconds* )
|
||||||
|
|
||||||
|
This command allows you to specify the PWM pulse in milliseconds rather than seconds.
|
||||||
|
|
||||||
|
``` python
|
||||||
|
s1.setPWMmS(1.5) # middle
|
||||||
|
s1.setPWMmS(2.0) # fully clockwise
|
||||||
|
s1.setPWMmS(1.0) # fully counter clockwise
|
||||||
|
```
|
||||||
|
|
||||||
#### Select a Stepper motor
|
#### Select a Stepper motor
|
||||||
|
|
||||||
You can control up to 3 stepper motors with the 640 board - each stepper motor uses two motor ports for 4 wire stepper motors and three motor ports for 5 wire stepper motors.
|
You can control up to 3 stepper motors with the 640 board - each stepper motor uses two motor ports for 4 wire stepper motors and three motor ports for 5 wire stepper motors.
|
||||||
|
|||||||
Reference in New Issue
Block a user