diff --git a/lambda/Makefile b/lambda/Makefile index 8da700c..5525397 100644 --- a/lambda/Makefile +++ b/lambda/Makefile @@ -3,7 +3,7 @@ MCU = atmega328p # Currently supported are 1 MHz and 8 MHz -F_CPU = 1000000 +F_CPU = 8000000 # Also try BAUD = 19200 or 38400 if you're feeling lucky. BAUD = 9600 diff --git a/lambda/airgate.c b/lambda/airgate.c index 8acb078..9d7cab6 100644 --- a/lambda/airgate.c +++ b/lambda/airgate.c @@ -92,7 +92,6 @@ void makeSteps(void) { if (steps > 0) { PORTB ^= (1 << PB7); - pos += dir; done++; steps--; if (done < ramp && speed < MAX_SPEED) { @@ -105,6 +104,7 @@ // linearize an unfavourably increasing acceleration curve OCR2A = (MIN_SPEED * MAX_SPEED) / speed; } else { + pos += (done * dir); done = 0; // move to new target position if necessary set();