0

Motor HAT for Raspberry Pi library
Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Please be positive and constructive with your questions and comments.

Motor HAT for Raspberry Pi library

by keviin55 on Fri Sep 24, 2021 3:02 am

Hi, I am a "newbie" and I am using the Stepper Motor HAT for Raspberry Pi. Every thing is working fine, I am just wondering if there is some functions in the library to handle acceleration/deceleration. I have read the documentation herehttps://learn.adafruit.com/adafruit-dc-and-stepper-motor-hat-for-raspberry-pi/using-stepper-motors but I could not found anything In the example codes

Code: Select all | TOGGLE FULL SIZE
    kit.stepper1.onestep()
    time.sleep(0.01)


I am supposed to manually calculate the optimal sleep time to create a reasonable acceleration/deceleration?

keviin55
 
Posts: 3
Joined: Wed Sep 15, 2021 3:59 am

Re: Motor HAT for Raspberry Pi library

by adafruit_support_carter on Fri Sep 24, 2021 12:50 pm

There's nothing in the library that does accel/decel. You'd need to implement that in your user code. It's just a matter of changing the actual delay time in that loop programmatically over time.

adafruit_support_carter
 
Posts: 21434
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.