aether.robotics wrote:Tried compiling the code from the example but loads of compile errors, also the build in the file is in .exe format, and I'm running ubuntu.
Any suggestions.
Thanks
Chris paton
#include <stdio.h>
#include <unistd.h>
#include <termios.h>
#include <fcntl.h>
int main(void) {
unsigned char data[11] = {0xff, 0xff, 0x01, 0x07, 0x03, 0x1e, 0xff, 0x03, 0x00, 0x02, 0xff};
unsigned char receive1[11] = {0};
unsigned char receive2[6] = {0};
int i;
int fp = open("/dev/ttyS2", O_RDWR | O_NOCTTY); // i use com3 (TX/RX short)
if(fp < 0) return 1;
termios term;
term.c_cflag |= CLOCAL | CREAD;
term.c_cflag &= ~(CSIZE);
term.c_cflag |= CS8; // 8 bits
term.c_cflag &= ~(PARENB); // no parity
term.c_cflag &= ~(CSTOPB); // 1 stopbit
cfsetospeed (&term, B115200); // output baudrate = 115200
cfsetispeed (&term, B115200); // input baudrate = 115200
term.c_iflag = IGNPAR; // No detect parity for input data.
term.c_oflag = 0;
term.c_lflag = 0;
term.c_cc[VTIME] = 10; // timeout = 1s
term.c_cc[VMIN] = 0;
tcflush(fp, TCIFLUSH);
tcsetattr(fp, TCSANOW, &term);
data[10] = ~(data[2] + data[3] + data[4] + data[5] + data[6] + data[7] + data[8] + data[9]);
write(fp, data, 11);
read(fp, receive1, 11);
read(fp, receive2, 6);
printf("Receive data from RoBoard :");
for(i=0; i<11; i++) printf("%X ", receive1[i]);
printf("\n");
printf("Receive data from AX-12 Servo :");
for(i=0; i<6; i++) printf("%X ", receive2[i]);
printf("\n");
close(fp);
return 0;
}
roboard wrote:We are currently porting Dynamixel sdk and chrisvo's libkondo to RoBoard RB-100/110/050's native COM ports (COM2 & COM3). ...