Anyone have any experience with the SD84 servo controller?
I'm going to use it primarily as a board for NINA's sensor array, but I'm having a bit of trouble trying to get readings from it in Python.
I have been able to find some resources out there for using python with the SD84 using the serial module, but I'm mainly having a hard time getting the SD84 to return anything.
For example, if I try to set analogue channels 1-4 and then check to see if those channels are set using the GET_AD_CNT command, I don't get anything if I try to read it...
Below is the python code I'm using:
#Test script for communicating with the SD84
#Adapted from "Time Sinkers" python interface to the SD84
import serial
sync='\xAA\xA0\x55'
SET_SERVO='\x01'
SET_MODE='\x04'
SET_AD_CNT = '\x06'
GET_VERSION='\x0A'
GET_AD_CNT = '\x07'
def Get_Analogue():
GET_ADC_CHANNELS = ('\xAA\xA0\x55\x07\00\00')
ser.write(GET_ADC_CHANNELS)
Analogue = ser.read(1)
print "Analogue Channels set ="+Analogue
# Open Serial port to FTDI usb serial tty
ser = serial.Serial('com4', baudrate=115200, bytesize=8, parity='N', stopbits=2,timeout=1)
# Send GET_VERSION command
ser.write(sync+GET_VERSION+'\x02\x00')
# Read the returned version and print
ver=ser.read(2)
print "VERSION:"+ver
# set SERVO mode
ser.write(sync+SET_MODE+'\x11\x01\x19')
#set Analogue mode
ser.write(sync+SET_AD_CNT+'\01\04')
Get_Analogue()
#Read return code (should be \x00 if all is well)
ser.read(1)
The version prints okay, just nothing else. Any pointers? Could it also be that I'm not setting the analogue channels correctly?