L6470を使用した秋月のステッピングモータードライバをうごかすライブラリとプログラム,なおもともとあるやつをぱくった上で機能を追加している
Dependencies: mbed
main.cpp
- Committer:
- ryuna
- Date:
- 2014-11-11
- Revision:
- 0:298e718ad4cb
File content as of revision 0:298e718ad4cb:
#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++; */ } }