step(steps)

描述

使步进马达转动指定的步数。转动的速度则依据 setSpeed() 的设定。该函式是阻塞(blocking)型,也就是在步进马达转动到指定的步数前,该函式不会结束去执行下一行程式码。举例来说,如果你的步进马达转一圈需要 100 步并且转动速度设定为 1 RPM,那执行 step(100) 所要花的时间就是 1 分钟。

参数

steps:步进马达转动的步数,参数的正负代表方向,型态为 int

回传

无回传值

See also

Stepper()
setSpeed()


函式库参考主页面

The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.