DFRobot
Published © MIT

Get Started with Unihiker Serial Port to Control Robots

How to use the Unihiker device to control a hexapod robot using a USB serial port.

IntermediateProtip206
Get Started with Unihiker Serial Port to Control Robots

Things used in this project

Hardware components

UNIHIKER M10 - IoT Python Programming Single Board Computer with Touchscreen
DFRobot UNIHIKER M10 - IoT Python Programming Single Board Computer with Touchscreen
×1
DFRobot USB to TTL converter
×1
Type-C power cable
×1
Hexapod robot
×1

Story

Read more

Code

code

Python
import serial
import time
 
ser = serial.Serial("/dev/ttyUSBport",9600)
forward = [0x55,0x55,0x05,0x06,0x15,0x01,0x00]
backward = [0x55,0x55,0x05,0x06,0x16,0x01,0x00]
left = [0x55,0x55,0x05,0x06,0x07,0x01,0x00]
right = [0x55,0x55,0x05,0x06,0x08,0x01,0x00]
 
ser.write(forward) 
time.sleep(2)
ser.write(backward) 
time.sleep(2)
ser.write(left)
time.sleep(2)
ser.write(right)  
time.sleep(2) 

Credits

DFRobot
67 projects • 156 followers
Empowering Creation for Future Innovators

Comments