hello!
I'm trying to interface my arduino due with the jrk21v3 using the following code (software serial):
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2,3); // 2 - tx, 3 - rx
int target = 2500; // this is the target speed that I want for the jrk motor controller.
byte serialBytes[2]; // declare an array for the speed command
void setup()
{
// set the data rate for the SoftwareSerial port
mySerial.begin(9600);
}
void loop()
{
serialBytes[0] = 0xC0 + ( target & 0x1F); // Command byte holds the lower 5 bits of target.
serialBytes[1] = (target >> 5) & 0x7F; // Data byte holds the upper 7 bits of target.
//0xAA, device number, 0x40 + target low 5 bits, target high 7 bits
//Send a Pololu Protocol command
mySerial.write(0xAA); //start byte
mySerial.write(0x0B); //device id
mySerial.write(0x40); //command number
mySerial.write(serialBytes[0]); //speed
mySerial.write(serialBytes[1]); //speed
}
which is similar to the code from this thread:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1283904250and my jrk is configured to:
serial input, UART detect baud rate, device number 11,no CRC, with analog feedback.
when i use to USB to my computer, i can control the motor no problem, but then i connect the arduino to the JRK, the jrk does not respond to the arduinos serial command
could anyone help out? (unfortunately this is for a school project

)
Thanks!