From: Mjolnir Date: Wed, 2 Sep 2015 13:52:09 +0000 (+0200) Subject: clean X-Git-Url: https://git.thomaspietrzak.com/?a=commitdiff_plain;h=63ab12472b14d1d51ec305573879112b4b46df95;p=livingdesktop.git clean --- diff --git a/GCodeParser/GCodeParser.ino b/GCodeParser/GCodeParser.ino index 7eaad32..b9f755b 100644 --- a/GCodeParser/GCodeParser.ino +++ b/GCodeParser/GCodeParser.ino @@ -95,9 +95,6 @@ void setup() } //other initialization. init_process_string(); - //init_steppers(); - //process_string("G90",3);//Absolute Position - //Serial.println("start"); } void loop() @@ -119,79 +116,10 @@ void loop() else if (serial_count < COMMAND_SIZE) { commands[serial_count] = c; - serial_count++; + serial_count++ } } else delayMicroseconds(100); } - -/* -void loop() -{ - - char c; - //read in characters if we got them. - if (Serial.available() > 0) - { - c = Serial.read(); - no_data = 0; - //newlines are ends of commands. - if (c != '\n') - { - if (c == 'I') - Serial.println(F("XYPlotter")); - else if (c == 'C') - { - init_steppers(); - process_string("G90",3);//Absolute Position - } - else - { - if (c == '(') - comment = true; - - // If we're not in comment mode, add it to our array. - if (!comment) - { - commands[serial_count] = c; - serial_count++; - } - if (c == ')') - comment = false; // End of comment - start listening again - } - - } - } - else - { - no_data++; - delayMicroseconds(100); - - //if theres a pause or we got a real command, do it - if (serial_count && (c == '\n' || no_data > 100)) - { - //process our command! - process_string(commands, serial_count); - //clear command. - init_process_string(); - } - - //no data? turn off steppers - if (no_data > 1000){ - disable_steppers(); - } - } - // return; - // delay(5); - // int dPos = abs(currentPosServo-targetPosServo); - // if(currentPosServo8?6:1; - // }else if(currentPosServo>targetPosServo){ - // currentPosServo -= dPos>8?6:1; - // } - - -}*/ -