Ok so I am at my wits end here, I can’t seem to get this controller to move my servos. There is power hooked up to the servos and I am in Mini SSC II Mode.
Here is the code I am using (the problem is most likely in here, but I know little about interfacing to a serial port). Whenever I run the program the green transfer LED flashes briefly so I’m assuming its receiving the data.
int main(){
struct termios newtio;
int fd;
fd = open("/dev/ttyUSB1", O_RDWR | O_NOCTTY);
newtio.c_cflag = BAUD | CRTSCTS | DATABITS | STOPBITS | PARITYON | PARITY | CLOCAL | CREAD;
newtio.c_iflag = IGNPAR;
newtio.c_oflag = 0;
newtio.c_lflag = 0;
newtio.c_cc[VMIN]=1;
newtio.c_cc[VTIME]=0;
tcflush(fd, TCIFLUSH);
tcsetattr(fd,TCSANOW,&newtio);
char Key = (char)255;
write(fd, &Key, 1);
Key = (char)18;
write(fd, &Key, 1);
Key = (char)254;
write(fd, &Key, 1);
close(fd);
}
Another thing that I think is odd is that when I first plug the controller into the USB of my computer it appears to run through its start up sequence fine. I pull out my volt-meter to test connectivity and all the + pins are connected to + input for the servo controller and likewise for the - pins (which is fine). However when I run the above program all the pins (signal/+/-) become connected to eachother…is this supposed to happen?
Thanks for any help.
EDIT:
Forgot to mention that I am not using a servo from Pololu. It is a Hitech HS-422 servo.
-Brian Peasley