kopia lustrzana https://github.com/gnea/grbl
added some gcode to test with
rodzic
65b696f2f9
commit
6ac3b3f2e6
Plik diff jest za duży
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]);
|
||||
|
|
|
@ -8,6 +8,10 @@ options_parser = OptionParser.new do |opts|
|
|||
opts.on('-v', '--verbose', 'Output more information') do
|
||||
$verbose = true
|
||||
end
|
||||
|
||||
opts.on('-p', '--prebuffer', 'Prebuffer commands') do
|
||||
$prebuffer = true
|
||||
end
|
||||
|
||||
opts.on('-h', '--help', 'Display this screen') do
|
||||
puts opts
|
||||
|
@ -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
|
||||
|
|
Ładowanie…
Reference in New Issue