linear motor code for ksk
LinearMotor.cpp@2:81a944155520, 2017-02-25 (annotated)
- Committer:
- cws8262
- Date:
- Sat Feb 25 08:14:13 2017 +0000
- Revision:
- 2:81a944155520
- Parent:
- 1:ff295adcca59
ds
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| cws8262 | 0:bc6aa7a92c1b | 1 | #include "LinearMotor.h" |
| cws8262 | 0:bc6aa7a92c1b | 2 | #include "mbed.h" |
| cws8262 | 1:ff295adcca59 | 3 | Serial pc1(SERIAL_TX, SERIAL_RX); |
| cws8262 | 0:bc6aa7a92c1b | 4 | |
| cws8262 | 0:bc6aa7a92c1b | 5 | LinearMotor::LinearMotor(PinName Dir, PinName Pulse, PinName St, PinName Limit) |
| cws8262 | 1:ff295adcca59 | 6 | :dir(Dir), pulse(Pulse), st(St), limit(Limit) |
| cws8262 | 0:bc6aa7a92c1b | 7 | { |
| cws8262 | 1:ff295adcca59 | 8 | st.write(1); |
| cws8262 | 1:ff295adcca59 | 9 | limit.mode(PullUp); |
| cws8262 | 0:bc6aa7a92c1b | 10 | } |
| cws8262 | 0:bc6aa7a92c1b | 11 |