Credit for the author
Fork of sMotor by
Embed:
(wiki syntax)
Show/hide line numbers
sMotor.h
00001 /* 00002 ############################################ 00003 ## sMotor v0.1 Library ## 00004 ## created by Samuel Matildes ## 00005 ############################################ 00006 ---- sam.naeec@gmail.com ----- 00007 This library was made for 4-Phase Stepper Motors 00008 I don't take any resposability for the damage caused to your equipment. 00009 00010 */ 00011 #ifndef MBED_SMOTOR_H 00012 #define MBED_SMOTOR_H 00013 00014 #include "mbed.h" 00015 00016 class sMotor { 00017 public: 00018 00019 sMotor(PinName A0, PinName A1, PinName A2, PinName A3); //motor constructor 00020 00021 void step(int num_steps, int direction, int speed); 00022 void anticlockwise(int current_step); 00023 void clockwise(int current_step); 00024 void stop(step); 00025 void delay(int delay_time); 00026 00027 private: 00028 00029 DigitalOut _A0; 00030 DigitalOut _A1; 00031 DigitalOut _A2; 00032 DigitalOut _A3; 00033 00034 }; 00035 00036 #endif
Generated on Thu Jul 14 2022 02:51:40 by 1.7.2