Eventhough there are a lot of libraries/code out there dealing with this IC, the lack of some basic or even advanced functionalities lead to the development of this one.
- Non blocking code
- Unittested
- Adjustable code
- Optional Debug messages
-
Basic
- Adjustable speed
- Coasting
- Braking
- Motor status flags
- Running
- Direction
- Accelerating
- Braking
- Coasting
- Full stop brake on
- CW limit triggered
- CCW limit triggered
- Overcurrent
- Configuration error
-
Advanced / Optional
- Acceleration
- Deceleration
- Position feedback
- Limits setup
- Collision detection (digital)
- Motor position (analog)
- Max current
Download and unzip L298
folder in arduino's Library
folder
All time-dependent functions are written without using the delay() function
With a lot of functionlaity, comes a lot of overhead. -- Unknown programmer
Since having a ton of functionality available on your disposal sounds great, on the contrary unecessary code adds up to limited resources.
The user has the ability to strip out not needed code by editing the L298.h
header file.
// comment out the following line to disable "ACCELERATION" functions
#define ACCELERATION_FUNCTIONS
// comment out the following line to disable "CURRENT" functions
#define CURRENT_FUNCTIONS
// comment out the following line to disable "LIMITING" functions
#define LIMITING_FUNCTIONS
// comment out the following line to disable "POSITION" functions
#define POSITION_FUNCTIONS
Feel free to fork this repository, mess around and make pull requests.