[Stepper]
描述
This function creates a new instance of the Stepper class that represents a particular stepper motor attached to your 86Duino board. Use it at the top of your sketch, above setup() 以及 loop(). The number of parameters depends on how you’ve wired your motor – either using two or four pins of the 86Duino board.
語法
Stepper(steps, pin1, pin2) Stepper(steps, pin1, pin2, pin3, pin4)
參數
steps: the number of steps in one revolution of your motor. If your motor gives the number of degrees per step, divide that number into 360 to get the number of steps (e.g., 360 / 3.6 gives 100 steps). (int)pin1,pin2: two pins that are attached to the motor (int)pin3,pin4: optional the last two pins attached to the motor if it’s connected to four pins (int)
回傳
A new instance of the Stepper motor class.
範例
Stepper myStepper = Stepper(100, 5, 6);
參考
函式庫參考主頁面
86Duino 參考的文本是根據 知識共享署名-相同方式分享 3.0 許可證,部分文本是從 Arduino 參考 修改的。 參考中的代碼示例已發佈到公共領域。