im trying to use my qik 2s12v10 qith my raspberry pi 3b and its not working on.I have used before with arduino and it’s working. I think that its no receiving what im trying to send by the serial port. Here is the code.
#! /usr/bin/python
import serial
import time
ser = serial.Serial(’/dev/ttyS0’, 115200, timeout=0.5) # open serial port
a1=‘AA0A086F’
arr = bytes(a1, ‘utf-8’)
print(arr)
ser.write(arr)
time.sleep(2)
a4=‘AA0A0800’
arr1 = bytes(a4, ‘utf-8’)
print(arr1)
ser.write(arr1) # motor 0 speed to 0
time.sleep(1)
ser.close()
The physical conections are right. These are in the same way that are mentions in preview reviews.
I have use other code before:
import serial
import time
s = serial.Serial("/dev/ttyS0", 115200, timeout=0.5)
s.write( chr(0xAA) + chr(0x09) + chr(0x0A) + chr(0x7F) ) # motor 0 full speed reverse
time.sleep(2)
s.write( chr(0xAA) + chr(0x09) + chr(0x0A) + chr(0x00) ) # motor 0 stop
s.close()
But I obtain this error