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.
Diff: stepper.h
- Revision:
- 0:4e3ad938564e
- Child:
- 1:40e5ac1119a6
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stepper.h Tue Jun 28 21:32:51 2022 +0000 @@ -0,0 +1,22 @@ +#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); + void step_positive(); + void step_negative(); + int32_t get_steps(); + void reset_step_count(); + + private: + DigitalOut enable; + DigitalOut step; + DigitalOut dir; + DigitalOut ms1; + DigitalOut ms2; + DigitalOut ms3; + int32_t count; +}; \ No newline at end of file