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.h
- Committer:
- fionalin
- Date:
- 2022-08-04
- Revision:
- 2:d9745be6c253
- Parent:
- 1:40e5ac1119a6
File content as of revision 2:d9745be6c253:
#pragma once #include <mbed.h> class StepperMotor { public: StepperMotor(PinName enable_pin, PinName step_pin, PinName dir_pin, PinName ms1_pin, PinName ms2_pin, PinName ms3_pin, PinName sleep_pin); void step_positive(); void step_negative(); int32_t get_steps(); void reset_step_count(); private: DigitalOut enable; PwmOut step; DigitalOut dir; DigitalOut ms1; DigitalOut ms2; DigitalOut ms3; DigitalOut sleep; int32_t count; };