motor bipolar
Dependencies: mbed
main.cpp@0:307508ae08e6, 2019-11-19 (annotated)
- Committer:
- Javierdf
- Date:
- Tue Nov 19 05:07:07 2019 +0000
- Revision:
- 0:307508ae08e6
motor bipolar
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Javierdf | 0:307508ae08e6 | 1 | #include "mbed.h" |
Javierdf | 0:307508ae08e6 | 2 | |
Javierdf | 0:307508ae08e6 | 3 | BusOut M1(D0,D1,D2,D3); |
Javierdf | 0:307508ae08e6 | 4 | char pos[4]={0x5,0x06,0x0A,0x09}; |
Javierdf | 0:307508ae08e6 | 5 | char i; |
Javierdf | 0:307508ae08e6 | 6 | |
Javierdf | 0:307508ae08e6 | 7 | int main() |
Javierdf | 0:307508ae08e6 | 8 | { |
Javierdf | 0:307508ae08e6 | 9 | while (true) { |
Javierdf | 0:307508ae08e6 | 10 | M1=pos[0]; |
Javierdf | 0:307508ae08e6 | 11 | wait(0.5); |
Javierdf | 0:307508ae08e6 | 12 | |
Javierdf | 0:307508ae08e6 | 13 | M1=pos[1]; |
Javierdf | 0:307508ae08e6 | 14 | wait(0.5); |
Javierdf | 0:307508ae08e6 | 15 | |
Javierdf | 0:307508ae08e6 | 16 | M1=pos[2]; |
Javierdf | 0:307508ae08e6 | 17 | wait(0.5); |
Javierdf | 0:307508ae08e6 | 18 | |
Javierdf | 0:307508ae08e6 | 19 | M1=pos[3]; |
Javierdf | 0:307508ae08e6 | 20 | wait(0.5); |
Javierdf | 0:307508ae08e6 | 21 | } |
Javierdf | 0:307508ae08e6 | 22 | } |