数字舵机Arduino扩展板

产品说明

此板内部集成半双工电路。这意味着你的UART发送线被连接到所有的Cds55系列舵机。因此: 当你通过数据线发送一个命令,所有的舵机都会收到信息。但因为发送的信息中包含指定的舵机ID号, 所以只有ID号匹配的舵机才会处理该信息。 因为舵机可以用串行总线连接在一起,它可以连接至少200个舵机。每个都可以反馈它的位置,转速,转矩,电流,以及温度等。它可以做全角度的旋转,就像齿轮电机一样可以控制速度。此特性使得它可以作为轮式机器人或履带机器人的马达。

应用领域

特性列表

引脚说明

Digital Servo Shield for Ardhuino_PinOut

更多细节

连接图表

Digital Servo Shield for Ardhuino_Diagram

示例代码

ServoCds55库文件下载

/* start code */
/*
# This Sample code is for testing the Digital Servo Shield.

# Editor : Phoebe
# Date   : 2013.5.17
# Ver    : 0.1
# Product: Digital Servo Shield for Arduino
# SKU    :

# Hardwares:
1. Arduino UNO
2. Digital Servo Shield for Arduino
3. Digital Servos( Compatible with CDS55xx...etc)
4. Power supply:6.5 - 12V

*/

#include <SPI.h>
#include <ServoCds55.h>
#include "pins_arduino.h"
ServoCds55 myservo;

void setup (void) {
    Serial.begin (115200);
    digitalWrite(SS, HIGH);
    SPI.begin ();
    SPI.setClockDivider(SPI_CLOCK_DIV8);
}

void loop (void) {
    if(Serial.available()){
        char val = Serial.read();
        if(val != -1) {
            switch(val) {
            case 'p':
                myservo.write(1,300);//ID:1  Pos:300  velocity:150
                delay(3000);
                myservo.write(1,0);//ID:1  Pos:0  velocity:150
                break;

            case 'v':
                myservo.setVelocity(100);// set velocity to 100(range:0-300) in Servo mode
                break;

            case 'm':
                myservo.rotate(1,150);//   CCW    ID:1  Velocity: 150  middle velocity  300 max
                delay(2000);
                myservo.rotate(1,-150);//  CW     ID:1  Velocity: -150  middle velocity  -300 max
                break;

                //    case 'i':
                //      myservo.SetID(1,2);//ID:1   newID:2
                //      break;
                //
                //    case 'r':
                //       myservo.Reset(2);//Restore ID2 servo to factory Settings ( ID:1  Baud rate:1000000)
                //       break;

            }
        }
        else
            Serial.println("Wait");
        delay(500);
    }
}

/* end code */

<File:nextredirectltr.png>购买数字舵机Arduino扩展板(SKU:DRI0027)