
L6470を使用した秋月のステッピングモータードライバをうごかすライブラリとプログラム,なおもともとあるやつをぱくった上で機能を追加している
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:298e718ad4cb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Nov 11 09:11:47 2014 +0000 @@ -0,0 +1,62 @@ +#include "mbed.h" +#include <L6470.h> +DigitalOut myled(LED1); + + +L6470 Step(p11,p12,p13,p14,p15);//msoi,miso,sclk,_cs + + + +int main() { + + int i = 0; + Step.Resets(); + Step.GoMark(); + + Step.BusyWait(0); + + Step.GoHome(); + + Step.BusyWait(0); + //Step.ResetPos(); + wait(0.5); + + + Step.Step(-90); + + Step.BusyWait(0); + + Step.Step(720); + + Step.BusyWait(0); + Step.GoHome(); + + while(1) { + /* + Step.Spin360(i); + Step.BusyWait(0); + if(i >360) { + i = 0; + Step.GoHome(); + } + i++; + */ + + + + + + + + + + + + + + + + + + } +}