Shop OBEX P1 Docs P2 Docs Learn Events
Scribbler2/Fluke2 gcode project: revising s2.spin questions — Parallax Forums

Scribbler2/Fluke2 gcode project: revising s2.spin questions

gcodergcoder Posts: 3
edited 2012-11-26 16:21 in Robotics
(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
Sign In or Register to comment.