Team repo
Embed:
(wiki syntax)
Show/hide line numbers
Motor.h
00001 #ifndef MBED_MOTOR_H 00002 #define MBED_MOTOR_H 00003 00004 #include "mbed.h" 00005 00006 class Motor { 00007 public: 00008 Motor(PinName _M1PWM, PinName _M2PWM, PinName _M1DIR, PinName _M2DIR, PinName _D2, int default_delay); 00009 void clockwise(); 00010 void anticlockwise(); 00011 void clockwise(int delay); 00012 void anticlockwise(int delay); 00013 void step_clockwise(int steps); 00014 void step_anticlockwise(int steps); 00015 void step_clockwise(int steps, int delay); 00016 void step_anticlockwise(int steps, int delay); 00017 void run (bool t); 00018 void run2 (bool t); 00019 void initialize (int middle); 00020 00021 int delay; 00022 int length; 00023 bool dir; 00024 int steps; 00025 00026 private: 00027 DigitalOut M1PWM; 00028 DigitalOut M2PWM; 00029 DigitalOut M1DIR; 00030 DigitalOut M2DIR; 00031 DigitalOut D2; 00032 00033 00034 }; 00035 00036 #endif
Generated on Sat Jul 16 2022 15:10:49 by
1.7.2