Scribbler2/Fluke2 gcode project: revising s2.spin questions
(If this question belongs in another forum, let me know where it should be and I will delete and repost).
Hi everyone!
I just joined the Parallax forums. I am working on a Scribbler2/Fluke2 project that involves sending gcode instructions over Bluetooth from a Java-based client. I am using some of the Scribbler.java code from the Myro project as a starting point. The current status of the project is that I have it working for simple shapes but it is choking on complex shapes with lots of gcode instructions. My guess is that I am blowing out the serial buffers by sending instructions too frequently.
So here is my question: In order to sequence sending gcode commands to the Scribbler, I need to know when a current movement command has been completed.
In pseudo code here is what I am currently doing:
beginPath(speed);
moveTo(x, y) // sent every n milliseconds -
endPath();
It appears that the s2.spin code echoes every command it receives but that echo is simply confirmation, nothing more. There appears to be no existing method to set a callback for when a movement command has actually been completed. I have tried polling the Scribbler for position in order to compare that to the last position command sent but haven't been able to get that working yet. I also don't understand how beginPath/endPath work - what sort of buffer size on the S2 side exists etc.
I haven't programmed in Spin before and do not yet fully understand the s2.spin code in order to see how to adapt it so I thought I would ask here before diving in. Does anyone know how I can get confirmation of movement complete? Has anyone hacked into the s2.spin code to attempt something like this?
-Thanks
Hi everyone!
I just joined the Parallax forums. I am working on a Scribbler2/Fluke2 project that involves sending gcode instructions over Bluetooth from a Java-based client. I am using some of the Scribbler.java code from the Myro project as a starting point. The current status of the project is that I have it working for simple shapes but it is choking on complex shapes with lots of gcode instructions. My guess is that I am blowing out the serial buffers by sending instructions too frequently.
So here is my question: In order to sequence sending gcode commands to the Scribbler, I need to know when a current movement command has been completed.
In pseudo code here is what I am currently doing:
beginPath(speed);
moveTo(x, y) // sent every n milliseconds -
endPath();
It appears that the s2.spin code echoes every command it receives but that echo is simply confirmation, nothing more. There appears to be no existing method to set a callback for when a movement command has actually been completed. I have tried polling the Scribbler for position in order to compare that to the last position command sent but haven't been able to get that working yet. I also don't understand how beginPath/endPath work - what sort of buffer size on the S2 side exists etc.
I haven't programmed in Spin before and do not yet fully understand the s2.spin code in order to see how to adapt it so I thought I would ask here before diving in. Does anyone know how I can get confirmation of movement complete? Has anyone hacked into the s2.spin code to attempt something like this?
-Thanks