Tedd OKANO
/
unipolar_stepper_motor_operation_sample
Diff: main.cpp
- Revision:
- 9:e568dea69ab5
- Parent:
- 8:6f3f8e5da87b
- Child:
- 10:f00d0b8775d4
diff -r 6f3f8e5da87b -r e568dea69ab5 main.cpp --- a/main.cpp Sat Jan 11 02:08:45 2014 +0000 +++ b/main.cpp Sat Jan 11 02:11:56 2014 +0000 @@ -1,7 +1,7 @@ // stepper motor operation sample (learn it step by step). // showing how to control a unipolar stepper motor by mbed digital output ports. // -// version 5 : Smaller loop using array index +// version 6 : 2-phase drive #include "mbed.h" @@ -9,7 +9,11 @@ #define INTERVAL 0.01 -char pattern[] = { 1, 2, 4, 8 }; +// 1-phase drive pattern +// char pattern[] = { 1, 2, 4, 8 }; + +// 2-phase drive pattern +char pattern[] = { 0x3, 0x6, 0xC, 0x9 }; int main() {