Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
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.

IntermediateProtip168
Get Started with Unihiker Serial Port to Control Robots

Things used in this project

Hardware components

UNIHIKER - IoT Python Programming Single Board Computer with Touchscreen
DFRobot UNIHIKER - 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
66 projects • 151 followers
Empowering Creation for Future Innovators
Contact

Comments

Please log in or sign up to comment.