Hello,
On Sunday, 23 January 2022 15:29:35 AEST Brian C wrote:
> Connecting a TB6600 driver to a Nema 17 stepper. I've gotten this to work
> fine with the Stepper library integrated with Arduino's Sketch IDE. Trying
> to use AccelStepper.
>
> However, using AccelStepper , the constructor requires (x6) arguments.
> How can this code ever work? The include file clearly shows only one
> possible constructor.
There are 2 possible constructors
AccelStepper(uint8_t interface = AccelStepper::FULL4WIRE, uint8_t pin1 = 2,
uint8_t pin2 = 3, uint8_t pin3 = 4, uint8_t pin4 = 5, bool enable = true);
6 arguments, all optional
AccelStepper(void (*forward)(), void (*backward)());
2 arguments, both pointers, none optional.
Cheers.
>
> -B
>
> *CODE*
> void setup() {
> #define _PIN_DIRECTION 6
> #define _PIN_PULSE 7
>
> #include <AccelStepper.h>
> AccelStepper stepper(1, _PIN_PULSE, _PIN_DIRECTION);
> }
>
> void loop() {
> }
>
> *COMPILER ERROR*
> In file included from
> C:\Users\...\Documents\Arduino\testAccelStepperDriver\testAccelStepperDriver
> .ino:7:0:
> C:\Users\...\Documents\Arduino\libraries\AccelStepper\src/AccelStepper.h:37
> 3:5: warning: 'setup()::AccelStepper::AccelStepper(uint8_t, uint8_t,
> uint8_t, uint8_t, uint8_t, bool)' used but never defined
> AccelStepper(uint8_t interface = AccelStepper::FULL4WIRE, uint8_t pin1
> = 2, uint8_t pin2 = 3, uint8_t pin3 = 4, uint8_t pin4 = 5, bool enable =
> true);
> ^~~~~~~~~~~~
> C:\Users\...\AppData\Local\Temp\ccC0Vm6p.ltrans0.ltrans.o: In function
> `setup':
> C:\Users\...\Documents\Arduino\testAccelStepperDriver/testAccelStepperDriver
> .ino:9: undefined reference to `setup::AccelStepper::AccelStepper(unsigned
> char, unsigned char, unsigned char, unsigned char, unsigned char, bool)'
> collect2.exe: error: ld returned 1 exit status
> exit status 1
> Error compiling for board Arduino Uno.
>
> *INCLUDE (*.H)*
> AccelStepper(uint8_t interface = AccelStepper::FULL4WIRE, uint8_t pin1 = 2,
> uint8_t pin2 = 3, uint8_t pin3 = 4, uint8_t pin4 = 5, bool enable = true);
--
Mike McCauley VK4AMM
mi...@airspayce.com
Airspayce Pty Ltd 9 Bulbul Place Currumbin Waters QLD 4223 Australia
http://www.airspayce.com 5R3MRFM2+X6
Phone
+61 7 5598-7474