diff options
Diffstat (limited to 'usb-i2c-sl018')
-rw-r--r-- | usb-i2c-sl018/stepper.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/usb-i2c-sl018/stepper.c b/usb-i2c-sl018/stepper.c index 4264a42..673b494 100644 --- a/usb-i2c-sl018/stepper.c +++ b/usb-i2c-sl018/stepper.c @@ -25,7 +25,8 @@ #include <avr/interrupt.h> #include "stepper.h" - +//half steps +/* uint8_t step_table [] = { 10, // 1010 @@ -37,6 +38,15 @@ uint8_t step_table [] = 6, // 0110 2, // 0010 }; +*/ +//Full steps +uint8_t step_table [] = +{ + 10, // 1010 + 9, // 1001 + 5, // 0101 + 6, // 0110 +}; #define STEPPER_PORT PORTF #define STEPPER_DDR DDRF @@ -46,7 +56,7 @@ uint8_t step_table [] = #define STEPPER_OUTPUT_BITMASK (~(0xF << STEPPER_FIRST_BIT )) volatile uint16_t step_cnt = 0; -static uint16_t step_cnt_max = LENGTH_STEP_TABLE*200; +static uint16_t step_cnt_max = LENGTH_STEP_TABLE*2000; stepper_direction_t step_direction = dir_open; inline void stop_stepper(void) |