I'm working on a project where I have to send string commands to a stepper motor controller. These commands look typically like "10030XYG" or "-1500X45000YG" and tell the control board how many steps to move the X or Y motors. I have a separate program that can take commands that I type in, load these command strings into an array, and send them out to the control board as needed. But, what I really want to to is randomly generate the X and Y positions, convert those to strings, append the X/Y/G charachters, and then load them into the array.

I'm trying to get my head around getting everything in a string format that will load into the "char* stepArray[]" string array. So, I made another test program shown here in order to get this portion to work. I'm using String objects for now, but they don't seem to agree with the char* stepArray[]. I get a "String_Tests:51: error: cannot convert 'String' to 'char*' in initialization" error line. I understand string objects are not recommended due to memory issues. But, so far, trying to get one command string out of a character array is proving difficult. I've also fooled around with using "ltoa" to convert the random long numbers into strings, but then I have to append the letters and so forth.

I think that if I can get my stepArray[] array to load up, I should have this issue licked. Thanks for any help and recommendations,--> K

Don't use String (the object)! use the str (char array) functions or sprint() Or DIY it, lookup (it's handed out to students as an exercise) writing your own routine to convert an int to a string. Hint lots of dividing by ten to do.