Open dtex opened 8 years ago
multi
does NOT work but mine
does
in other words calling mine([1000, 2000])
works but calling multi()
does not
Also while I have your attention @dtex do you know who I can contact to get this merged ? https://github.com/firmata/firmata.js/pull/261 . I cant seem to get in touch with anyone that works on firmata js
I think @rwaldron is the only one able to merge PRs on that repo.
Ok thanks will try to get in touch with him. Also for anyone that attempts to use the methods described above with accelStepper and Johnny five with the latest stepper drivers make sure you check the pulse width settings inside of AccelStepper.cpp
read the info about your stepper driver from its manual ( it should say minimum pulse width ). I needed to update mine to be 8.5. If you are using an arduino uno it defaults it to 5. For teensy boards it does not so you may be scratching your head for hours trying to figure out why your motors are not moving and its as simple as changing the pulse width.
Also I would like to add for anyone using a teensy4.1 board you need to add the following code to the Boards.h
in the firmatas src/utility
directory
// Teensy 4.0 & 4.1
#elif defined(__IMXRT1062__)
#define TOTAL_ANALOG_PINS NUM_ANALOG_INPUTS
#define TOTAL_PINS NUM_DIGITAL_PINS
#define VERSION_BLINK_PIN 13
#define PIN_SERIAL1_RX 0
#define PIN_SERIAL1_TX 1
#define PIN_SERIAL2_RX 7
#define PIN_SERIAL2_TX 8
#define PIN_SERIAL3_RX 15
#define PIN_SERIAL3_TX 14
#define PIN_SERIAL4_RX 16
#define PIN_SERIAL4_TX 17
#define PIN_SERIAL5_RX 21
#define PIN_SERIAL5_TX 20
#define PIN_SERIAL6_RX 25
#define PIN_SERIAL6_TX 24
#define PIN_SERIAL7_RX 28
#define PIN_SERIAL7_TX 29
#define IS_PIN_DIGITAL(p) ((p) >= 0 && (p) < NUM_DIGITAL_PINS)
#ifdef ARDUINO_TEENSY40
#define IS_PIN_ANALOG(p) ((p) >= 14 && (p) <= 27)
#define PIN_TO_ANALOG(p) ((p) - 14)
#endif
#ifdef ARDUINO_TEENSY41
#define IS_PIN_ANALOG(p) (((p) >= 14 && (p) <= 27) || ((p) >= 38 && (p) <= 41))
#define PIN_TO_ANALOG(p) (((p) <= 27) ? (p) - 14 : (p) - 24)
#endif
#define IS_PIN_PWM(p) digitalPinHasPWM(p)
#define IS_PIN_SERVO(p) ((p) >= 0 && (p) < MAX_SERVOS)
#define IS_PIN_I2C(p) ((p) == PIN_WIRE_SDA || (p) == PIN_WIRE_SCL)
#define IS_PIN_SERIAL(p) (((p) >= 0 && (p) <= 1) || ((p) >= 7 && (p) <= 8) || ((p) >= 14 && (p) <= 17) || ((p) >= 20 && (p) <= 21) || ((p) >= 24 && (p) <= 25) || ((p) >= 28 && (p) <= 29))
#define PIN_TO_DIGITAL(p) (p)
#define PIN_TO_PWM(p) (p)
#define PIN_TO_SERVO(p) (p)
I'm working on a project that requires getting down into stepper and I have a proposed addition. I want to be able to control the enable pin of a motor controller to shut off a stepper so it's not consuming power when it is not needed (and getting super hot).
I could do this independently of the stepper class by controlling an independent digital pin, or I could integrate it as a parameter on stepper. For example:
Four-Wire
or Two Wire
Alternately enable could be a separate param: