--- title: "Biomodd 血汗小組之跑吧!燈光!" tags: hackpad --- # Biomodd 血汗小組之跑吧!燈光! > [點此觀看原始內容](https://openlabtaipei.hackpad.tw/AcK81Zp4zm5) Biomodd 血汗小組之跑吧!燈光! ### 介紹 我們就是要駭客掃描機,讓掃描機發光不停地來回移動。 ### 硬體 arduino l298n 步進馬達驅動模組 scanmaker 4700 (使用 [S35S2](http://www.datasheetarchive.com/S35S2-datasheet.html) 步進馬達) ### 程式碼 ``` #include <Stepper.h> const int steps = 1200; Stepper myStepper(steps,9,10,11,12); void setup() { myStepper.setSpeed(20); } void loop() { myStepper.step(steps); delay(1000); myStepper.step(-steps); delay(1000); } ``` ### 討論 > 馬達好燙,如何解決? > [name=鄭鴻旗] > 如何幫馬達定位,才不會撞到旁邊? > [name=Cindy W] 馬達好燙:電流過大(btw, 找到的datasheet是錯的) Solution: 1. L298n改用EasyDriver Board 提供pulse,full step之頻率可被分割為half step/quarter step/ eighth step,有效減少發熱 2. (用L298n)自己寫code,可將full stepe改為half step ### 參考資料 - [Setting up the Stepper Motor](http://expediteapps.com/blog/setting-up-the-stepper-motor/) -
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up