I have modified OM_serial_control, OM_motor_control and added 3 variables in OpenMoco_TimeLapse_engine
unsigned long pasos_a_mover = steps that I must move
byte direccion_a_mover = direcction I must move the motor
byte motor_a_mover = number of motor to move
In OM_motor_control I have modified
void motor_pulse_steps_linear( byte motor, unsigned int steps )
If motor to move is 0 or 3 I let the program to run without modifications
if motor is 1 or 2 first of all I save the content of input_serial_buffer and , then I assing 100 to input_serial_buffer and 100 to input_serial_buffer after that I call serial_program_action (), then I restore the previous values of input_serial_buffer 0 and 1.
serial_program_action is modified to allow when input_serial_buffer 0 and 1 are equal to 100 to send via serial port this info:
// action data
serial_write( motor_a_mover ); // a byte
serial_write( direccion_a_mover ); // a byte
serial_write( pasos_a_mover ); // a unsigned long
sent = true;
and now, my problem is that openmoco-slim do not recognice a command sent by openmoco-engine with that data inside.
Then I request you a little modification in openmoco-slim to allow it to receive that kind of message and to discard it, because this message goes to the second arduino not for the computer.
This would allow me and other people make motorized heads based on DC motors with encoders, or use existing ones jet in the market.
I ask you this because I do not program in perl.