step motor portout ile calistirma
Dependencies: mbed
main.cpp@0:75bd93370a68, 2019-12-18 (annotated)
- Committer:
- marvas
- Date:
- Wed Dec 18 11:13:06 2019 +0000
- Revision:
- 0:75bd93370a68
step motor portout ile calistirma
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
marvas | 0:75bd93370a68 | 1 | #include "mbed.h" |
marvas | 0:75bd93370a68 | 2 | PortOut step_motor(PortB,0xC006); |
marvas | 0:75bd93370a68 | 3 | int main() |
marvas | 0:75bd93370a68 | 4 | { |
marvas | 0:75bd93370a68 | 5 | while(1) |
marvas | 0:75bd93370a68 | 6 | { |
marvas | 0:75bd93370a68 | 7 | step_motor=0x0002;//PB_1 hex |
marvas | 0:75bd93370a68 | 8 | wait_ms(3); |
marvas | 0:75bd93370a68 | 9 | step_motor=0x0004;//PB_2 hex |
marvas | 0:75bd93370a68 | 10 | wait_ms(3); |
marvas | 0:75bd93370a68 | 11 | step_motor=0x4000;//PB_14 hex |
marvas | 0:75bd93370a68 | 12 | wait_ms(3); |
marvas | 0:75bd93370a68 | 13 | step_motor=0x8000;//PB_15 hex |
marvas | 0:75bd93370a68 | 14 | wait_ms(3); |
marvas | 0:75bd93370a68 | 15 | } |
marvas | 0:75bd93370a68 | 16 | return 0; |
marvas | 0:75bd93370a68 | 17 | } |