赞
踩
学习STM32Core平台串口2连接维特智能串口Normal协议,然后通过串口1直接连接舵机控制板(TTL),接收进行通信;需要看产品文档的可以直接官网搜索文档。
16路舵机控制板官方产品网址
在查看这个例程前请阅读相关说明书,了解舵机控制板所使用的协议,以及控制板的基本功能、
点击查看16路舵机控制板
16路舵机控制板
1、’可同时支持16路舵机大的输出
2、支持TTL 串口通信
3、支持上位机软件控制动作以及动作组
4、串口初始化为9600
如下图所示为官方提供资料
实物图图下
硬件操作流程
第一种
stm32控制板-------------usart1-------------------->16路舵机控制板
第二种
上位机软件 --------------usb ---------------16路舵机控制班。
上位机软件如下图
我的接线图
下面我用自己的开发板接的如下如 ,(16路舵机控制板)
设计采用的芯片是STM32F103ZET6,采用的16路舵机控制板,自主进行电路设计,通过串口传输,完成对16路舵机控制板串口通信完成动作。
下面直接上示例代码,(可下载官方的代码参考移植,上面有官网地址)-
主函数
void UART1_Put_StringL(unsigned char *Str,unsigned char len) { unsigned char i = 0; for (i=0;i<len;i++) UART1_Put_Char(*(Str + i)); } void UART_DM_ReportData(unsigned char data[]) { UART1_Put_StringL(data,10); //打印长度根据所打印的数组长度来改,动作组是5,速度状态是10。最好填10。 } //**********动作组及各种舵机的速度角度配置都在“BOOL.h”头文件里面******// //**********直接把数组名称放在UART_DM_ReportData()函数里面就可以了,例如UART_DM_ReportData(DM0_Speed1_Position_90)********// /******************************************************************************* * 函 数 名 : main * 函数功能 : 主函数 * 输 入 : 无 * 输 出 : 无 *******************************************************************************/ int main() { u8 i=0; SysTick_Init(72); NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2); //中断优先级分组 分2组 LED_Init(); USART1_Init(9600);//串口初始化为9600 while(1) { UART_DM_ReportData(DM0_Speed20_Position_90); //设置通道0,速度=1,位置=90度 delay_ms(10000); //延时2S UART_DM_ReportData(DM0_Speed20_Position_0); //设置通道0,速度=3,位置=0度 delay_ms(10000); UART_DM_ReportData(DM_Action0); //设置动作组0 delay_ms(2000); // UART_DM_ReportData(DM_Action1); //设置动作组1 // UART_DM_ReportData(DM_Action2); //设置动作组2 // UART_DM_ReportData(DM_Action3); //设置动作组3 // UART_DM_ReportData(DM_Action4); //设置动作组4 // UART_DM_ReportData(DM_Action5); //设置动作组5 // UART_DM_ReportData(DM_Action6); //设置动作组6 // UART_DM_ReportData(DM_Action7); //设置动作组7 // UART_DM_ReportData(DM_Action8); //设置动作组8 // UART_DM_ReportData(DM_Action9); //设置动作组9 // UART_DM_ReportData(DM_Action10); //设置动作组10 // UART_DM_ReportData(DM_Action11); //设置动作组11 // UART_DM_ReportData(DM_Action12); //设置动作组12 // UART_DM_ReportData(DM_Action13); //设置动作组13 // UART_DM_ReportData(DM_Action14); //设置动作组14 // UART_DM_ReportData(DM_Action15); //设置动作组15 } }
串口文件参考
#include "usart.h" #include "system.h" #include "string.h" #include <stdio.h> #include "system.h" //#include "stm32f10x.h" #include "stm32f10x_gpio.h" #include "stm32f10x_usart.h" #include "stm32f10x_rcc.h" #include "misc.h" #include "bool.h" static unsigned char TxBuffer[256]; static unsigned char TxCounter=0; static unsigned char count=0; extern void CopeSerial1Data(unsigned char ucData); int fputc(int ch,FILE *p) //函数默认的,在使用printf函数时自动调用 { USART_SendData(USART1,(u8)ch); while(USART_GetFlagStatus(USART1,USART_FLAG_TXE)==RESET); return ch; } //串口1中断服务程序 //注意,读取USARTx->SR能避免莫名其妙的错误 u8 USART1_RX_BUF[USART1_REC_LEN]; //接收缓冲,最大USART_REC_LEN个字节. //接收状态 //bit15, 接收完成标志 //bit14, 接收到0x0d //bit13~0, 接收到的有效字节数目 u16 USART1_RX_STA=0; //接收状态标记 /******************************************************************************* * 函 数 名 : USART1_Init * 函数功能 : USART1初始化函数 * 输 入 : bound:波特率 * 输 出 : 无 *******************************************************************************/ void USART1_Init(u32 bound) { //GPIO端口设置 GPIO_InitTypeDef GPIO_InitStructure; USART_InitTypeDef USART_InitStructure; NVIC_InitTypeDef NVIC_InitStructure; RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA,ENABLE); RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1,ENABLE); /* 配置GPIO的模式和IO口 */ GPIO_InitStructure.GPIO_Pin=GPIO_Pin_9;//TX //串口输出PA9 GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_Mode=GPIO_Mode_AF_PP; //复用推挽输出 GPIO_Init(GPIOA,&GPIO_InitStructure); /* 初始化串口输入IO */ GPIO_InitStructure.GPIO_Pin=GPIO_Pin_10;//RX //串口输入PA10 GPIO_InitStructure.GPIO_Mode=GPIO_Mode_IN_FLOATING; //模拟输入 GPIO_Init(GPIOA,&GPIO_InitStructure); /* 初始化GPIO */ //USART1 初始化设置 USART_InitStructure.USART_BaudRate = bound;//波特率设置 USART_InitStructure.USART_WordLength = USART_WordLength_8b;//字长为8位数据格式 USART_InitStructure.USART_StopBits = USART_StopBits_1;//一个停止位 USART_InitStructure.USART_Parity = USART_Parity_No;//无奇偶校验位 USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;//无硬件数据流控制 USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx; //收发模式 USART_Init(USART1, &USART_InitStructure); //初始化串口1 USART_Cmd(USART1, ENABLE); //使能串口1 USART_ClearFlag(USART1, USART_FLAG_TC); USART_ITConfig(USART1, USART_IT_RXNE, ENABLE);//开启相关中断 //Usart1 NVIC 配置 NVIC_InitStructure.NVIC_IRQChannel = USART1_IRQn;//串口1中断通道 NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority=3;//抢占优先级3 NVIC_InitStructure.NVIC_IRQChannelSubPriority =3; //子优先级3 NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; //IRQ通道使能 NVIC_Init(&NVIC_InitStructure); //根据指定的参数初始化VIC寄存器、 } /******************************************************************************* * 函 数 名 : USART1_IRQHandler * 函数功能 : USART1中断函数 * 输 入 : 无 * 输 出 : 无 *******************************************************************************/ //void USART1_IRQHandler(void) //串口1中断服务程序 //{ // u8 r; // if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET) //接收中断 // { // r =USART_ReceiveData(USART1);//(USART1->DR); //读取接收到的数据 // if((USART1_RX_STA&0x8000)==0)//接收未完成 // { // if(USART1_RX_STA&0x4000)//接收到了0x0d // { // if(r!=0x0a)USART1_RX_STA=0;//接收错误,重新开始 // else USART1_RX_STA|=0x8000; //接收完成了 // } // else //还没收到0X0D // { // if(r==0x0d)USART1_RX_STA|=0x4000; // else // { // USART1_RX_BUF[USART1_RX_STA&0X3FFF]=r; // USART1_RX_STA++; // if(USART1_RX_STA>(USART1_REC_LEN-1))USART1_RX_STA=0;//接收数据错误,重新开始接收 // } // } // } // } //} void UART1_Put_Char(unsigned char DataToSend) { TxBuffer[count++] = DataToSend; USART_ITConfig(USART1, USART_IT_TXE, ENABLE); } void UART1_Put_String(unsigned char *Str) { while(*Str) { if(*Str=='\r')UART1_Put_Char(0x0d); else if(*Str=='\n')UART1_Put_Char(0x0a); else UART1_Put_Char(*Str); Str++; } } void CopeSerial1Data(unsigned char ucData) { } void USART1_IRQHandler(void) { if(USART_GetITStatus(USART1, USART_IT_TXE) != RESET) { USART_SendData(USART1, TxBuffer[TxCounter++]); if(TxCounter == count) { USART_ITConfig(USART1, USART_IT_TXE, DISABLE);// 全部发送完成 } USART_ClearITPendingBit(USART1, USART_IT_TXE); } else if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET) { CopeSerial1Data((unsigned char)USART1->DR);//处理数据 USART_ClearITPendingBit(USART1, USART_IT_RXNE); } USART_ClearITPendingBit(USART1,USART_IT_ORE); }
bool 官方参数直接下载拿过来用
#ifndef _bool_H #define _bool_H //****************************************位置角度控制****************************************// static unsigned char DM0_Speed1_Position_90[15] = { 0xff, 0x01, 0x00, 0x01, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 }; //通道0,速度=1,位置90度 static unsigned char DM0_Speed2_Position_90[15] = { 0xff, 0x01, 0x00, 0x02, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 }; //通道0,速度=2,位置90度 static unsigned char DM0_Speed3_Position_90[15] = { 0xff, 0x01, 0x00, 0x03, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 }; //通道0,速度=3,位置90度 static unsigned char DM0_Speed4_Position_90[15] = { 0xff, 0x01, 0x00, 0x04, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 }; //通道0,速度=4,位置90度 static unsigned char DM0_Speed5_Position_90[15] = { 0xff, 0x01, 0x00, 0x05, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 }; //通道0,速度=5,位置90度 static unsigned char DM0_Speed6_Position_90[15] = { 0xff, 0x01, 0x00, 0x06, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 }; //通道0,速度=6,位置90度 static unsigned char DM0_Speed7_Position_90[15] = { 0xff, 0x01, 0x00, 0x07, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 }; //通道0,速度=7,位置90度 static unsigned char DM0_Speed8_Position_90[15] = { 0xff, 0x01, 0x00, 0x08, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 }; //通道0,速度=8,位置90度 static unsigned char DM0_Speed9_Position_90[15] = { 0xff, 0x01, 0x00, 0x09, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 }; //通道0,速度=9,位置90度 static unsigned char DM0_Speed10_Position_90[15] = { 0xff, 0x01, 0x00, 0x0a, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 }; //通道0,速度=10,位置90度 static unsigned char DM0_Speed11_Position_90[15] = { 0xff, 0x01, 0x00, 0x0b, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 }; //通道0,速度=11,位置90度 static unsigned char DM0_Speed12_Position_90[15] = { 0xff, 0x01, 0x00, 0x0c, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 }; //通道0,速度=12,位置90度 static unsigned char DM0_Speed13_Position_90[15] = { 0xff, 0x01, 0x00, 0x0d, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 }; //通道0,速度=13,位置90度 static unsigned char DM0_Speed14_Position_90[15] = { 0xff, 0x01, 0x00, 0x0e, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 }; //通道0,速度=14,位置90度 static unsigned char DM0_Speed15_Position_90[15] = { 0xff, 0x01, 0x00, 0x0f, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 }; //通道0,速度=15,位置90度 static unsigned char DM0_Speed16_Position_90[15] = { 0xff, 0x01, 0x00, 0x10, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 }; //通道0,速度=16,位置90度 static unsigned char DM0_Speed17_Position_90[15] = { 0xff, 0x01, 0x00, 0x11, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 }; //通道0,速度=17,位置90度 static unsigned char DM0_Speed18_Position_90[15] = { 0xff, 0x01, 0x00, 0x12, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 }; //通道0,速度=18,位置90度 static unsigned char DM0_Speed19_Position_90[15] = { 0xff, 0x01, 0x00, 0x13, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 }; //通道0,速度=19,位置90度 static unsigned char DM0_Speed20_Position_90[15] = { 0xff, 0x01, 0x00, 0x14, 0x00, 0xff, 0x02, 0x00, 0xdc, 0x05 }; //通道0,速度=20,位置90度 static unsigned char DM0_Speed1_Position_0[15] = { 0xff, 0x01, 0x00, 0x01, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 }; //通道0,速度=1,位置0度 static unsigned char DM0_Speed2_Position_0[15] = { 0xff, 0x01, 0x00, 0x02, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 }; //通道0,速度=2,位置0度 static unsigned char DM0_Speed3_Position_0[15] = { 0xff, 0x01, 0x00, 0x03, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 }; //通道0,速度=3,位置0度 static unsigned char DM0_Speed4_Position_0[15] = { 0xff, 0x01, 0x00, 0x04, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 }; //通道0,速度=4,位置0度 static unsigned char DM0_Speed5_Position_0[15] = { 0xff, 0x01, 0x00, 0x05, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 }; //通道0,速度=5,位置0度 static unsigned char DM0_Speed6_Position_0[15] = { 0xff, 0x01, 0x00, 0x06, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 }; //通道0,速度=6,位置0度 static unsigned char DM0_Speed7_Position_0[15] = { 0xff, 0x01, 0x00, 0x07, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 }; //通道0,速度=7,位置0度 static unsigned char DM0_Speed8_Position_0[15] = { 0xff, 0x01, 0x00, 0x08, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 }; //通道0,速度=8,位置0度 static unsigned char DM0_Speed9_Position_0[15] = { 0xff, 0x01, 0x00, 0x09, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 }; //通道0,速度=9,位置0度 static unsigned char DM0_Speed10_Position_0[15] = { 0xff, 0x01, 0x00, 0x0a, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 }; //通道0,速度=10,位置0度 static unsigned char DM0_Speed11_Position_0[15] = { 0xff, 0x01, 0x00, 0x0b, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 }; //通道0,速度=11,位置0度 static unsigned char DM0_Speed12_Position_0[15] = { 0xff, 0x01, 0x00, 0x0c, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 }; //通道0,速度=12,位置0度 static unsigned char DM0_Speed13_Position_0[15] = { 0xff, 0x01, 0x00, 0x0d, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 }; //通道0,速度=13,位置0度 static unsigned char DM0_Speed14_Position_0[15] = { 0xff, 0x01, 0x00, 0x0e, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 }; //通道0,速度=14,位置0度 static unsigned char DM0_Speed15_Position_0[15] = { 0xff, 0x01, 0x00, 0x0f, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 }; //通道0,速度=15,位置0度 static unsigned char DM0_Speed16_Position_0[15] = { 0xff, 0x01, 0x00, 0x10, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 }; //通道0,速度=16,位置0度 static unsigned char DM0_Speed17_Position_0[15] = { 0xff, 0x01, 0x00, 0x11, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 }; //通道0,速度=17,位置0度 static unsigned char DM0_Speed18_Position_0[15] = { 0xff, 0x01, 0x00, 0x12, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 }; //通道0,速度=18,位置0度 static unsigned char DM0_Speed19_Position_0[15] = { 0xff, 0x01, 0x00, 0x13, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 }; //通道0,速度=19,位置0度 static unsigned char DM0_Speed20_Position_0[15] = { 0xff, 0x01, 0x00, 0x14, 0x00, 0xff, 0x02, 0x00, 0xf4, 0x01 }; //通道0,速度=20,位置0度 static unsigned char DM1_Speed1_Position_90[15] = { 0xff, 0x01, 0x01, 0x01, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 }; //通道1,速度=1,位置90度 static unsigned char DM1_Speed2_Position_90[15] = { 0xff, 0x01, 0x01, 0x02, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 }; //通道1,速度=2,位置90度 static unsigned char DM1_Speed3_Position_90[15] = { 0xff, 0x01, 0x01, 0x03, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 }; //通道1,速度=3,位置90度 static unsigned char DM1_Speed4_Position_90[15] = { 0xff, 0x01, 0x01, 0x04, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 }; //通道1,速度=4,位置90度 static unsigned char DM1_Speed5_Position_90[15] = { 0xff, 0x01, 0x01, 0x05, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 }; //通道1,速度=5,位置90度 static unsigned char DM1_Speed6_Position_90[15] = { 0xff, 0x01, 0x01, 0x06, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 }; //通道1,速度=6,位置90度 static unsigned char DM1_Speed7_Position_90[15] = { 0xff, 0x01, 0x01, 0x07, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 }; //通道1,速度=7,位置90度 static unsigned char DM1_Speed8_Position_90[15] = { 0xff, 0x01, 0x01, 0x08, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 }; //通道1,速度=8,位置90度 static unsigned char DM1_Speed9_Position_90[15] = { 0xff, 0x01, 0x01, 0x09, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 }; //通道1,速度=9,位置90度 static unsigned char DM1_Speed10_Position_90[15] = { 0xff, 0x01, 0x01, 0x0a, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 }; //通道1,速度=10,位置90度 static unsigned char DM1_Speed11_Position_90[15] = { 0xff, 0x01, 0x01, 0x0b, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 }; //通道1,速度=11,位置90度 static unsigned char DM1_Speed12_Position_90[15] = { 0xff, 0x01, 0x01, 0x0c, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 }; //通道1,速度=12,位置90度 static unsigned char DM1_Speed13_Position_90[15] = { 0xff, 0x01, 0x01, 0x0d, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 }; //通道1,速度=13,位置90度 static unsigned char DM1_Speed14_Position_90[15] = { 0xff, 0x01, 0x01, 0x0e, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 }; //通道1,速度=14,位置90度 static unsigned char DM1_Speed15_Position_90[15] = { 0xff, 0x01, 0x01, 0x0f, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 }; //通道1,速度=15,位置90度 static unsigned char DM1_Speed16_Position_90[15] = { 0xff, 0x01, 0x01, 0x10, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 }; //通道1,速度=16,位置90度 static unsigned char DM1_Speed17_Position_90[15] = { 0xff, 0x01, 0x01, 0x11, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 }; //通道1,速度=17,位置90度 static unsigned char DM1_Speed18_Position_90[15] = { 0xff, 0x01, 0x01, 0x12, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 }; //通道1,速度=18,位置90度 static unsigned char DM1_Speed19_Position_90[15] = { 0xff, 0x01, 0x01, 0x13, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 }; //通道1,速度=19,位置90度 static unsigned char DM1_Speed20_Position_90[15] = { 0xff, 0x01, 0x01, 0x14, 0x00, 0xff, 0x02, 0x01, 0xdc, 0x05 }; //通道1,速度=20,位置90度 static unsigned char DM1_Speed1_Position_0[15] = { 0xff, 0x01, 0x01, 0x01, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 }; //通道1,速度=1,位置0度 static unsigned char DM1_Speed2_Position_0[15] = { 0xff, 0x01, 0x01, 0x02, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 }; //通道1,速度=2,位置0度 static unsigned char DM1_Speed3_Position_0[15] = { 0xff, 0x01, 0x01, 0x03, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 }; //通道1,速度=3,位置0度 static unsigned char DM1_Speed4_Position_0[15] = { 0xff, 0x01, 0x01, 0x04, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 }; //通道1,速度=4,位置0度 static unsigned char DM1_Speed5_Position_0[15] = { 0xff, 0x01, 0x01, 0x05, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 }; //通道1,速度=5,位置0度 static unsigned char DM1_Speed6_Position_0[15] = { 0xff, 0x01, 0x01, 0x06, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 }; //通道1,速度=6,位置0度 static unsigned char DM1_Speed7_Position_0[15] = { 0xff, 0x01, 0x01, 0x07, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 }; //通道1,速度=7,位置0度 static unsigned char DM1_Speed8_Position_0[15] = { 0xff, 0x01, 0x01, 0x08, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 }; //通道1,速度=8,位置0度 static unsigned char DM1_Speed9_Position_0[15] = { 0xff, 0x01, 0x01, 0x09, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 }; //通道1,速度=9,位置0度 static unsigned char DM1_Speed10_Position_0[15] = { 0xff, 0x01, 0x01, 0x0a, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 }; //通道1,速度=10,位置0度 static unsigned char DM1_Speed11_Position_0[15] = { 0xff, 0x01, 0x01, 0x0b, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 }; //通道1,速度=11,位置0度 static unsigned char DM1_Speed12_Position_0[15] = { 0xff, 0x01, 0x01, 0x0c, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 }; //通道1,速度=12,位置0度 static unsigned char DM1_Speed13_Position_0[15] = { 0xff, 0x01, 0x01, 0x0d, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 }; //通道1,速度=13,位置0度 static unsigned char DM1_Speed14_Position_0[15] = { 0xff, 0x01, 0x01, 0x0e, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 }; //通道1,速度=14,位置0度 static unsigned char DM1_Speed15_Position_0[15] = { 0xff, 0x01, 0x01, 0x0f, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 }; //通道1,速度=15,位置0度 static unsigned char DM1_Speed16_Position_0[15] = { 0xff, 0x01, 0x01, 0x10, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 }; //通道1,速度=16,位置0度 static unsigned char DM1_Speed17_Position_0[15] = { 0xff, 0x01, 0x01, 0x11, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 }; //通道1,速度=17,位置0度 static unsigned char DM1_Speed18_Position_0[15] = { 0xff, 0x01, 0x01, 0x12, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 }; //通道1,速度=18,位置0度 static unsigned char DM1_Speed19_Position_0[15] = { 0xff, 0x01, 0x01, 0x13, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 }; //通道1,速度=19,位置0度 static unsigned char DM1_Speed20_Position_0[15] = { 0xff, 0x01, 0x01, 0x14, 0x00, 0xff, 0x02, 0x01, 0xf4, 0x01 }; //通道1,速度=20,位置0度 static unsigned char DM2_Speed1_Position_90[15] = { 0xff, 0x01, 0x02, 0x01, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 }; //通道2,速度=1,位置90度 static unsigned char DM2_Speed2_Position_90[15] = { 0xff, 0x01, 0x02, 0x02, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 }; //通道2,速度=2,位置90度 static unsigned char DM2_Speed3_Position_90[15] = { 0xff, 0x01, 0x02, 0x03, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 }; //通道2,速度=3,位置90度 static unsigned char DM2_Speed4_Position_90[15] = { 0xff, 0x01, 0x02, 0x04, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 }; //通道2,速度=4,位置90度 static unsigned char DM2_Speed5_Position_90[15] = { 0xff, 0x01, 0x02, 0x05, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 }; //通道2,速度=5,位置90度 static unsigned char DM2_Speed6_Position_90[15] = { 0xff, 0x01, 0x02, 0x06, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 }; //通道2,速度=6,位置90度 static unsigned char DM2_Speed7_Position_90[15] = { 0xff, 0x01, 0x02, 0x07, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 }; //通道2,速度=7,位置90度 static unsigned char DM2_Speed8_Position_90[15] = { 0xff, 0x01, 0x02, 0x08, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 }; //通道2,速度=8,位置90度 static unsigned char DM2_Speed9_Position_90[15] = { 0xff, 0x01, 0x02, 0x09, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 }; //通道2,速度=9,位置90度 static unsigned char DM2_Speed10_Position_90[15] = { 0xff, 0x01, 0x02, 0x0a, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 }; //通道2,速度=10,位置90度 static unsigned char DM2_Speed11_Position_90[15] = { 0xff, 0x01, 0x02, 0x0b, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 }; //通道2,速度=11,位置90度 static unsigned char DM2_Speed12_Position_90[15] = { 0xff, 0x01, 0x02, 0x0c, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 }; //通道2,速度=12,位置90度 static unsigned char DM2_Speed13_Position_90[15] = { 0xff, 0x01, 0x02, 0x0d, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 }; //通道2,速度=13,位置90度 static unsigned char DM2_Speed14_Position_90[15] = { 0xff, 0x01, 0x02, 0x0e, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 }; //通道2,速度=14,位置90度 static unsigned char DM2_Speed15_Position_90[15] = { 0xff, 0x01, 0x02, 0x0f, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 }; //通道2,速度=15,位置90度 static unsigned char DM2_Speed16_Position_90[15] = { 0xff, 0x01, 0x02, 0x10, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 }; //通道2,速度=16,位置90度 static unsigned char DM2_Speed17_Position_90[15] = { 0xff, 0x01, 0x02, 0x11, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 }; //通道2,速度=17,位置90度 static unsigned char DM2_Speed18_Position_90[15] = { 0xff, 0x01, 0x02, 0x12, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 }; //通道2,速度=18,位置90度 static unsigned char DM2_Speed19_Position_90[15] = { 0xff, 0x01, 0x02, 0x13, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 }; //通道2,速度=19,位置90度 static unsigned char DM2_Speed20_Position_90[15] = { 0xff, 0x01, 0x02, 0x14, 0x00, 0xff, 0x02, 0x02, 0xdc, 0x05 }; //通道2,速度=20,位置90度 static unsigned char DM2_Speed1_Position_0[15] = { 0xff, 0x01, 0x02, 0x01, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 }; //通道2,速度=1,位置0度 static unsigned char DM2_Speed2_Position_0[15] = { 0xff, 0x01, 0x02, 0x02, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 }; //通道2,速度=2,位置0度 static unsigned char DM2_Speed3_Position_0[15] = { 0xff, 0x01, 0x02, 0x03, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 }; //通道2,速度=3,位置0度 static unsigned char DM2_Speed4_Position_0[15] = { 0xff, 0x01, 0x02, 0x04, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 }; //通道2,速度=4,位置0度 static unsigned char DM2_Speed5_Position_0[15] = { 0xff, 0x01, 0x02, 0x05, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 }; //通道2,速度=5,位置0度 static unsigned char DM2_Speed6_Position_0[15] = { 0xff, 0x01, 0x02, 0x06, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 }; //通道2,速度=6,位置0度 static unsigned char DM2_Speed7_Position_0[15] = { 0xff, 0x01, 0x02, 0x07, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 }; //通道2,速度=7,位置0度 static unsigned char DM2_Speed8_Position_0[15] = { 0xff, 0x01, 0x02, 0x08, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 }; //通道2,速度=8,位置0度 static unsigned char DM2_Speed9_Position_0[15] = { 0xff, 0x01, 0x02, 0x09, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 }; //通道2,速度=9,位置0度 static unsigned char DM2_Speed10_Position_0[15] = { 0xff, 0x01, 0x02, 0x0a, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 }; //通道2,速度=10,位置0度 static unsigned char DM2_Speed11_Position_0[15] = { 0xff, 0x01, 0x02, 0x0b, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 }; //通道2,速度=11,位置0度 static unsigned char DM2_Speed12_Position_0[15] = { 0xff, 0x01, 0x02, 0x0c, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 }; //通道2,速度=12,位置0度 static unsigned char DM2_Speed13_Position_0[15] = { 0xff, 0x01, 0x02, 0x0d, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 }; //通道2,速度=13,位置0度 static unsigned char DM2_Speed14_Position_0[15] = { 0xff, 0x01, 0x02, 0x0e, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 }; //通道2,速度=14,位置0度 static unsigned char DM2_Speed15_Position_0[15] = { 0xff, 0x01, 0x02, 0x0f, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 }; //通道2,速度=15,位置0度 static unsigned char DM2_Speed16_Position_0[15] = { 0xff, 0x01, 0x02, 0x10, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 }; //通道2,速度=16,位置0度 static unsigned char DM2_Speed17_Position_0[15] = { 0xff, 0x01, 0x02, 0x11, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 }; //通道2,速度=17,位置0度 static unsigned char DM2_Speed18_Position_0[15] = { 0xff, 0x01, 0x02, 0x12, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 }; //通道2,速度=18,位置0度 static unsigned char DM2_Speed19_Position_0[15] = { 0xff, 0x01, 0x02, 0x13, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 }; //通道2,速度=19,位置0度 static unsigned char DM2_Speed20_Position_0[15] = { 0xff, 0x01, 0x02, 0x14, 0x00, 0xff, 0x02, 0x02, 0xf4, 0x01 }; //通道2,速度=20,位置0度 static unsigned char DM3_Speed10_Position_90[15] = { 0xff, 0x01, 0x03, 0x0a, 0x00, 0xff, 0x02, 0x03, 0xdc, 0x05 }; //通道3,速度=10,位置90度 static unsigned char DM3_Speed20_Position_90[15] = { 0xff, 0x01, 0x03, 0x14, 0x00, 0xff, 0x02, 0x03, 0xdc, 0x05 }; //通道3,速度=20,位置90度 static unsigned char DM3_Speed10_Position_0[15] = { 0xff, 0x01, 0x03, 0x0a, 0x00, 0xff, 0x02, 0x03, 0xf4, 0x01 }; //通道3,速度=10,位置0度 static unsigned char DM3_Speed20_Position_0[15] = { 0xff, 0x01, 0x03, 0x14, 0x00, 0xff, 0x02, 0x03, 0xf4, 0x01 }; //通道3,速度=20,位置0度 static unsigned char DM4_Speed10_Position_90[15] = { 0xff, 0x01, 0x04, 0x0a, 0x00, 0xff, 0x02, 0x04, 0xdc, 0x05 }; //通道4,速度=10,位置90度 static unsigned char DM4_Speed20_Position_90[15] = { 0xff, 0x01, 0x04, 0x14, 0x00, 0xff, 0x02, 0x04, 0xdc, 0x05 }; //通道4,速度=20,位置90度 static unsigned char DM4_Speed10_Position_0[15] = { 0xff, 0x01, 0x04, 0x0a, 0x00, 0xff, 0x02, 0x04, 0xf4, 0x01 }; //通道4,速度=10,位置0度 static unsigned char DM4_Speed20_Position_0[15] = { 0xff, 0x01, 0x04, 0x14, 0x00, 0xff, 0x02, 0x04, 0xf4, 0x01 }; //通道4,速度=20,位置0度 static unsigned char DM5_Speed10_Position_90[15] = { 0xff, 0x01, 0x05, 0x0a, 0x00, 0xff, 0x02, 0x05, 0xdc, 0x05 }; //通道5,速度=10,位置90度 static unsigned char DM5_Speed20_Position_90[15] = { 0xff, 0x01, 0x05, 0x14, 0x00, 0xff, 0x02, 0x05, 0xdc, 0x05 }; //通道5,速度=20,位置90度 static unsigned char DM5_Speed10_Position_0[15] = { 0xff, 0x01, 0x05, 0x0a, 0x00, 0xff, 0x02, 0x05, 0xf4, 0x01 }; //通道5,速度=10,位置0度 static unsigned char DM5_Speed20_Position_0[15] = { 0xff, 0x01, 0x05, 0x14, 0x00, 0xff, 0x02, 0x05, 0xf4, 0x01 }; //通道5,速度=20,位置0度 static unsigned char DM6_Speed10_Position_90[15] = { 0xff, 0x01, 0x06, 0x0a, 0x00, 0xff, 0x02, 0x06, 0xdc, 0x05 }; //通道6,速度=10,位置90度 static unsigned char DM6_Speed20_Position_90[15] = { 0xff, 0x01, 0x06, 0x14, 0x00, 0xff, 0x02, 0x06, 0xdc, 0x05 }; //通道6,速度=20,位置90度 static unsigned char DM6_Speed10_Position_0[15] = { 0xff, 0x01, 0x06, 0x0a, 0x00, 0xff, 0x02, 0x06, 0xf4, 0x01 }; //通道6,速度=10,位置0度 static unsigned char DM6_Speed20_Position_0[15] = { 0xff, 0x01, 0x06, 0x14, 0x00, 0xff, 0x02, 0x06, 0xf4, 0x01 }; //通道6,速度=20,位置0度 static unsigned char DM7_Speed10_Position_90[15] = { 0xff, 0x01, 0x07, 0x0a, 0x00, 0xff, 0x02, 0x07, 0xdc, 0x05 }; //通道7,速度=10,位置90度 static unsigned char DM7_Speed20_Position_90[15] = { 0xff, 0x01, 0x07, 0x14, 0x00, 0xff, 0x02, 0x07, 0xdc, 0x05 }; //通道7,速度=20,位置90度 static unsigned char DM7_Speed10_Position_0[15] = { 0xff, 0x01, 0x07, 0x0a, 0x00, 0xff, 0x02, 0x07, 0xf4, 0x01 }; //通道7,速度=10,位置0度 static unsigned char DM7_Speed20_Position_0[15] = { 0xff, 0x01, 0x07, 0x14, 0x00, 0xff, 0x02, 0x07, 0xf4, 0x01 }; //通道7,速度=20,位置0度 static unsigned char DM8_Speed10_Position_90[15] = { 0xff, 0x01, 0x08, 0x0a, 0x00, 0xff, 0x02, 0x08, 0xdc, 0x05 }; //通道8,速度=10,位置90度 static unsigned char DM8_Speed20_Position_90[15] = { 0xff, 0x01, 0x08, 0x14, 0x00, 0xff, 0x02, 0x08, 0xdc, 0x05 }; //通道8,速度=20,位置90度 static unsigned char DM8_Speed10_Position_0[15] = { 0xff, 0x01, 0x08, 0x0a, 0x00, 0xff, 0x02, 0x08, 0xf4, 0x01 }; //通道8,速度=10,位置0度 static unsigned char DM8_Speed20_Position_0[15] = { 0xff, 0x01, 0x08, 0x14, 0x00, 0xff, 0x02, 0x08, 0xf4, 0x01 }; //通道8,速度=20,位置0度 static unsigned char DM9_Speed10_Position_90[15] = { 0xff, 0x01, 0x09, 0x0a, 0x00, 0xff, 0x02, 0x09, 0xdc, 0x05 }; //通道9,速度=10,位置90度 static unsigned char DM9_Speed20_Position_90[15] = { 0xff, 0x01, 0x09, 0x14, 0x00, 0xff, 0x02, 0x09, 0xdc, 0x05 }; //通道9,速度=20,位置90度 static unsigned char DM9_Speed10_Position_0[15] = { 0xff, 0x01, 0x09, 0x0a, 0x00, 0xff, 0x02, 0x09, 0xf4, 0x01 }; //通道9,速度=10,位置0度 static unsigned char DM9_Speed20_Position_0[15] = { 0xff, 0x01, 0x09, 0x14, 0x00, 0xff, 0x02, 0x09, 0xf4, 0x01 }; //通道9,速度=20,位置0度 static unsigned char DM10_Speed10_Position_90[15] = { 0xff, 0x01, 0x0a, 0x0a, 0x00, 0xff, 0x02, 0x0a, 0xdc, 0x05 }; //通道10,速度=10,位置90度 static unsigned char DM10_Speed20_Position_90[15] = { 0xff, 0x01, 0x0a, 0x14, 0x00, 0xff, 0x02, 0x0a, 0xdc, 0x05 }; //通道10,速度=20,位置90度 static unsigned char DM10_Speed10_Position_0[15] = { 0xff, 0x01, 0x0a, 0x0a, 0x00, 0xff, 0x02, 0x0a, 0xf4, 0x01 }; //通道10,速度=10,位置0度 static unsigned char DM10_Speed20_Position_0[15] = { 0xff, 0x01, 0x0a, 0x14, 0x00, 0xff, 0x02, 0x0a, 0xf4, 0x01 }; //通道10,速度=20,位置0度 static unsigned char DM11_Speed10_Position_90[15] = { 0xff, 0x01, 0x0b, 0x0a, 0x00, 0xff, 0x02, 0x0b, 0xdc, 0x05 }; //通道11,速度=10,位置90度 static unsigned char DM11_Speed20_Position_90[15] = { 0xff, 0x01, 0x0b, 0x14, 0x00, 0xff, 0x02, 0x0b, 0xdc, 0x05 }; //通道11,速度=20,位置90度 static unsigned char DM11_Speed10_Position_0[15] = { 0xff, 0x01, 0x0b, 0x0a, 0x00, 0xff, 0x02, 0x0b, 0xf4, 0x01 }; //通道11,速度=10,位置0度 static unsigned char DM11_Speed20_Position_0[15] = { 0xff, 0x01, 0x0b, 0x14, 0x00, 0xff, 0x02, 0x0b, 0xf4, 0x01 }; //通道11,速度=20,位置0度 static unsigned char DM12_Speed10_Position_90[15] = { 0xff, 0x01, 0x0c, 0x0a, 0x00, 0xff, 0x02, 0x0c, 0xdc, 0x05 }; //通道12,速度=10,位置90度 static unsigned char DM12_Speed20_Position_90[15] = { 0xff, 0x01, 0x0c, 0x14, 0x00, 0xff, 0x02, 0x0c, 0xdc, 0x05 }; //通道12,速度=20,位置90度 static unsigned char DM12_Speed10_Position_0[15] = { 0xff, 0x01, 0x0c, 0x0a, 0x00, 0xff, 0x02, 0x0c, 0xf4, 0x01 }; //通道12,速度=10,位置0度 static unsigned char DM12_Speed20_Position_0[15] = { 0xff, 0x01, 0x0c, 0x14, 0x00, 0xff, 0x02, 0x0c, 0xf4, 0x01 }; //通道12,速度=20,位置0度 static unsigned char DM13_Speed10_Position_90[15] = { 0xff, 0x01, 0x0d, 0x0a, 0x00, 0xff, 0x02, 0x0d, 0xdc, 0x05 }; //通道13,速度=10,位置90度 static unsigned char DM13_Speed20_Position_90[15] = { 0xff, 0x01, 0x0d, 0x14, 0x00, 0xff, 0x02, 0x0d, 0xdc, 0x05 }; //通道13,速度=20,位置90度 static unsigned char DM13_Speed10_Position_0[15] = { 0xff, 0x01, 0x0d, 0x0a, 0x00, 0xff, 0x02, 0x0d, 0xf4, 0x01 }; //通道13,速度=10,位置0度 static unsigned char DM13_Speed20_Position_0[15] = { 0xff, 0x01, 0x0d, 0x14, 0x00, 0xff, 0x02, 0x0d, 0xf4, 0x01 }; //通道13,速度=20,位置0度 static unsigned char DM14_Speed10_Position_90[15] = { 0xff, 0x01, 0x0e, 0x0a, 0x00, 0xff, 0x02, 0x0e, 0xdc, 0x05 }; //通道14,速度=10,位置90度 static unsigned char DM14_Speed20_Position_90[15] = { 0xff, 0x01, 0x0e, 0x14, 0x00, 0xff, 0x02, 0x0e, 0xdc, 0x05 }; //通道14,速度=20,位置90度 static unsigned char DM14_Speed10_Position_0[15] = { 0xff, 0x01, 0x0e, 0x0a, 0x00, 0xff, 0x02, 0x0e, 0xf4, 0x01 }; //通道14,速度=10,位置0度 static unsigned char DM14_Speed20_Position_0[15] = { 0xff, 0x01, 0x0e, 0x14, 0x00, 0xff, 0x02, 0x0e, 0xf4, 0x01 }; //通道14,速度=20,位置0度 static unsigned char DM15_Speed10_Position_90[15] = { 0xff, 0x01, 0x0f, 0x0a, 0x00, 0xff, 0x02, 0x0f, 0xdc, 0x05 }; //通道15,速度=10,位置90度 static unsigned char DM15_Speed20_Position_90[15] = { 0xff, 0x01, 0x0f, 0x14, 0x00, 0xff, 0x02, 0x0f, 0xdc, 0x05 }; //通道15,速度=20,位置90度 static unsigned char DM15_Speed10_Position_0[15] = { 0xff, 0x01, 0x0f, 0x0a, 0x00, 0xff, 0x02, 0x0f, 0xf4, 0x01 }; //通道15,速度=10,位置0度 static unsigned char DM15_Speed20_Position_0[15] = { 0xff, 0x01, 0x0f, 0x14, 0x00, 0xff, 0x02, 0x0f, 0xf4, 0x01 }; //通道15,速度=20,位置0度 //********************动作组********************// static unsigned char DM_Action0[5] = { 0xff, 0x09, 0x00, 0x00, 0x00 }; //动作组0 static unsigned char DM_Action1[5] = { 0xff, 0x09, 0x00, 0x01, 0x00 }; //动作组1 static unsigned char DM_Action2[5] = { 0xff, 0x09, 0x00, 0x02, 0x00 }; //动作组2 static unsigned char DM_Action3[5] = { 0xff, 0x09, 0x00, 0x03, 0x00 }; //动作组3 static unsigned char DM_Action4[5] = { 0xff, 0x09, 0x00, 0x04, 0x00 }; //动作组4 static unsigned char DM_Action5[5] = { 0xff, 0x09, 0x00, 0x05, 0x00 }; //动作组5 static unsigned char DM_Action6[5] = { 0xff, 0x09, 0x00, 0x06, 0x00 }; //动作组6 static unsigned char DM_Action7[5] = { 0xff, 0x09, 0x00, 0x07, 0x00 }; //动作组7 static unsigned char DM_Action8[5] = { 0xff, 0x09, 0x00, 0x08, 0x00 }; //动作组8 static unsigned char DM_Action9[5] = { 0xff, 0x09, 0x00, 0x09, 0x00 }; //动作组9 static unsigned char DM_Action10[5] = { 0xff, 0x09, 0x00, 0x0a, 0x00 }; //动作组a static unsigned char DM_Action11[5] = { 0xff, 0x09, 0x00, 0x0b, 0x00 }; //动作组b static unsigned char DM_Action12[5] = { 0xff, 0x09, 0x00, 0x0c, 0x00 }; //动作组c static unsigned char DM_Action13[5] = { 0xff, 0x09, 0x00, 0x0d, 0x00 }; //动作组d static unsigned char DM_Action14[5] = { 0xff, 0x09, 0x00, 0x0e, 0x00 }; //动作组e static unsigned char DM_Action15[5] = { 0xff, 0x09, 0x00, 0x0f, 0x00 }; //动作组f #endif
总结:
单片机连接舵机控制板进行舵机角度控制,电池电压7.2V 舵机mg996/mg90s
舵机控制板波特率9600
一般的stm32 机 本身就有1到4个PWM 控制输出根据个人情况去定义程序和选择产品
串口通信的常规用法。后期会使用不同的产品更新
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。