« WordPress 升級 2.2 Google Analytics 新改版 »

五月17

StepMotor Driver & Test program

tags , | 801 views


FS2410XP 是滿多學校的嵌入式教學實驗平台,板子上有兩個馬達模組,廠商的 demo 程式有一些範例,我將步進馬達完整移植到 Embedded Linux 上,方便作更多的應用。附件包含驅動程式、測試程式及投影片。

在 DOS 的 C 程式有個有個函數叫 kbhit(),可動態偵測鍵盤有無輸入,不用停住等待,不過在 Linux 上沒有 kbhit() 及 getch() 可以用,好在國外有人實作出相同功能的函數,請參考 kbhit.c

StepMotor

用法:

  1. 進入 linux
  2. cd /tmp
  3. 輸入 rz 上傳 stepper.o、step_test
  4. insmod stepper.o
  5. mknod /dev/stepper c 225 0
  6. chmod 755 step_test
  7. ./step_test
Trackback:

Leave a Reply