Controlling Herkulex DRS-0101

OpenMV related project discussion.
Posts: 1
Joined: Mon Feb 04, 2019 11:01 am

Controlling Herkulex DRS-0101

Postby Marwaladeen » Mon Feb 04, 2019 11:15 am

Hi there,

I have got a school project using the OpenMV Cam M7, I would like to control a smart servomotor, the DRS-0101.
In order to do it, I must send data to the servo throught UART.
Here is an example : 0xFF 0xFF 0x0B 0x01 0x03 0xC6 0x38 (7 bytes to send one after an other).
Here is the communication protocol : Data Bit : 8, Stop Bit : 1, Parity : None, Flow Control : None, Baud Rate : 57 600.

I have made a script but it does not seem to be working :/ Any idea ?


Code: Select all

import sensor, image, time
from pyb import UART

sensor.skip_frames(time = 2000)

clock = time.clock()

servo = UART(1, 57600, timeout_char=1000)
servo.init(57600, bits=8, parity=None, stop=1,timeout_char=100)

data = [0xFF,0xFF,0x0C,0x01,0x06,0xEC,0x12,0x02,0xF4,0x01,0x10,0x01]

for i in range(len(data)):
    img = sensor.snapshot()

User avatar
Posts: 3990
Joined: Sun May 24, 2015 2:10 pm

Re: Controlling Herkulex DRS-0101

Postby kwagyeman » Mon Feb 04, 2019 11:29 am

Hi, the OpenMV Cam UART needs to be UART(3).

Return to “Project Discussion”

Who is online

Users browsing this forum: No registered users and 13 guests