使用串口调试助手向舵机控制板发送指令方法.pdfVIP

  • 2
  • 0
  • 约4.19千字
  • 约 12页
  • 2025-10-20 发布于北京
  • 举报

使用串口调试助手向舵机控制板发送指令方法.pdf

如何使用串口调试助手给舵机控制板发指令

舵机控制板是串口通讯的(TTL电平),可以使用任何串口设备给它发指令,从而

控制舵机。

对串口的要求:

1.必须为TTL电平(不是232电平)

2.TXD接RXD,RXD接TXD,GND接GND(反接,共地)

3.波特率为115200,无校验位,8位数据位,1位停止位,无控制流

命令格式说明:

如#1P1500T100\r\n

Howtousetheserialportdebuggingassistanttosend

commandstotheservocontrolboard

Theservocontrolboardusesserialcommunication(TTLlevel).Youcanuse

anyserialdevicetosendinstructionstoittocontroltheservo.

Requirementsfor

serialport:

1.MustbeTTLlevel(not232level)

2.TXDisconnectedtoRXD,RXDisconnectedtoTXD,GNDisconnectedtoGND(reverse

connection,commonground)

3.Baudrateis115200,noparitybit,8databits,1stopbit,nocontrolflow

Commandformat

description:

Suchas#1P1500T100\r\n

数字1为舵机控制板上的S1通道数字1500是控制舵机的角度(范围为500-

2500),控制舵机的0-180度

数字100是时间,时间的意思是,从当前的位置,旋转到命令中的位置,所需要的

时间。

最后\r\n是一个特殊字符,不能用串口调试助手直接发送出来。(注解1)

以上命令的意思就是:S1上插的舵机,在100ms的时间内。从现在位置旋转到

90度。

Thenumber1istheS1channelnumberontheservocontrolboard.1500is

theangleoftheservocontrol(rangeis500-2500),andthe0-180degree

controloftheservois

Thenumber100istime,whichmeansthetimerequiredtorotatefromthe

currentpositiontothepositioninthecommand.

Finally\r\nisaspecialcharacterandcannotbesentdirectlyusingtheserialportdebugging1)

assistant.(annotation

Themeaningoftheabovecommandis:theservopluggedintoS1within

100ms.Rotate90degreesfromyourcurrentposition.

注解1

上图中,是使用了我们自己的串口调试助手,注意下面的发送区令为

注解1

Inthepictureabove,ourownserialportdebuggingas

文档评论(0)

1亿VIP精品文档

相关文档