Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Stepper.cpp
- Committer:
- stvnrhodes
- Date:
- 2012-04-21
- Revision:
- 0:6e7505d77f6a
- Child:
- 1:52716241d0c4
File content as of revision 0:6e7505d77f6a:
#include "Stepper.h"
Stepper::Stepper(PinName step, PinName dir, PinName en) : _step(step), _dir(dir), _en(en) {
_step = 0, _dir = 0, _en = 1;
}
void Stepper::stepOn(bool direction) {
_dir = direction;
_step = 1;
}
void Stepper::stepOff(void) {
_step = 0;
}
void Stepper::enable(bool en) {
_en = !en;
}