added some gcode to test with

This commit is contained in:
Simen Svale Skogsrud 2010-01-07 23:14:29 +01:00
parent 65b696f2f9
commit 6ac3b3f2e6
4 changed files with 5356 additions and 7 deletions

5342
gcode/braid.gcode Normal file

File diff suppressed because it is too large Load Diff

View File

@ -91,9 +91,9 @@ void mc_line(double x, double y, double z, float feed_rate, int invert_feed_rate
// Setup ---------------------------------------------------------------------------------------------------
target[X_AXIS] = x*X_STEPS_PER_MM;
target[Y_AXIS] = y*Y_STEPS_PER_MM;
target[Z_AXIS] = z*Z_STEPS_PER_MM;
target[X_AXIS] = round(x*X_STEPS_PER_MM);
target[Y_AXIS] = round(y*Y_STEPS_PER_MM);
target[Z_AXIS] = round(z*Z_STEPS_PER_MM);
// Determine direction and travel magnitude for each axis
for(axis = X_AXIS; axis <= Z_AXIS; axis++) {
step_count[axis] = abs(target[axis] - position[axis]);

View File

@ -9,6 +9,10 @@ options_parser = OptionParser.new do |opts|
$verbose = true
end
opts.on('-p', '--prebuffer', 'Prebuffer commands') do
$prebuffer = true
end
opts.on('-h', '--help', 'Display this screen') do
puts opts
exit
@ -23,13 +27,16 @@ end
SerialPort.open('/dev/tty.usbserial-A4001o6L', 9600) do |sp|
ARGV.each do |file|
puts "Processing file #{file}"
prebuffer = 5
prebuffer = $prebuffer ? 10 : 0
File.readlines(file).each do |line|
sp.write("#{line.strip}\r\n");
next if line.strip == ''
puts line.strip
sp.write("#{line.strip}\r\n");
if prebuffer == 0
result = sp.gets
puts result unless result.strip == 'ok'
begin
result = sp.gets.strip
puts result unless result == '' or result == 'ok'
end while result != 'ok'
else
prebuffer -= 1
end