Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nadiamoe/smooth-stepper
Control stepper drivers with acceleration
https://github.com/nadiamoe/smooth-stepper
Last synced: 9 days ago
JSON representation
Control stepper drivers with acceleration
- Host: GitHub
- URL: https://github.com/nadiamoe/smooth-stepper
- Owner: nadiamoe
- Created: 2018-03-08T17:28:00.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-25T09:16:39.000Z (over 6 years ago)
- Last Synced: 2024-12-27T05:04:24.110Z (9 days ago)
- Language: C++
- Size: 6.84 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Smooth Stepper
Smooth Stepper is a library to control stepper motor drivers. It allows the user to set a target angular velocity and an acceleration, and the library takes care of the rest.
## Usage
```cpp
const int ENA = 27;
const int PUL = 23;
const int DIR = 25;Stepper stepper(PUL);
void setup() {
pinMode(ENA, OUTPUT);
pinMode(PUL, OUTPUT);
pinMode(DIR, OUTPUT);stepper.microsteps = 4;
stepper.setRpm(100); // rpm
stepper.accelRpm(200); // rpm/sdigitalWrite(ENA, HIGH);
digitalWrite(DIR, HIGH);
}void loop() {
stepper.step();
stepper.accelerate();if (millis() > 5e3 && millis() < 6e3) {
// Double the speed after 5 seconds.
stepper.setRpm(200);
}
}
```