Wansik Choi
/
linear_motor
linear motor code for ksk
LinearMotor.h
- Committer:
- cws8262
- Date:
- 2017-02-19
- Revision:
- 0:bc6aa7a92c1b
- Child:
- 1:ff295adcca59
File content as of revision 0:bc6aa7a92c1b:
#ifndef LiNMtR_0_0_1 #define LiNMtR_0_0_1 #include "mbed.h" class LinearMotor{ public: LinearMotor(PinName Dir, PinName Pulse, PinName St, PinName Limit); Ticker timer; DigitalOut dir; DigitalOut pulse; DigitalOut st; DigitalIn limit; double pos; double spd; double k;//gain for ticker time k/spd=interval void step(void); void move(double Pos); void spdset(double Spd); void init(void); } #endif