added some gcode to test with
This commit is contained in:
parent
65b696f2f9
commit
6ac3b3f2e6
5342
gcode/braid.gcode
Normal file
5342
gcode/braid.gcode
Normal file
File diff suppressed because it is too large
Load Diff
@ -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]);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user