Biomodd 血汗小組之跑吧!燈光!
介紹
我們就是要駭客掃描機,讓掃描機發光不停地來回移動。
硬體
arduino
l298n 步進馬達驅動模組
scanmaker 4700 (使用 S35S2 步進馬達)
程式碼
- #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);
- }
討論
馬達好燙:電流過大(btw, 找到的datasheet是錯的)
Solution:
- L298n改用EasyDriver Board 提供pulse,full step之頻率可被分割為half step/quarter step/ eighth step,有效減少發熱
- (用L298n)自己寫code,可將full stepe改為half step
參考資料
- Setting up the Stepper Motor