[Motion86]
説明
Switch the Machine object to MachineOn mode.
You must enter MachineOn mode before you can use any motion control-related methods. You cannot configure config-related methods after you enter MachineOn mode.
構文
machine.machineOn();
媒介変数
machine: Machine object.
No Parameter.
戻り値
No return.
例
Set the basic parameters of the machine, move after MachineOn, and then configure the configuration again after MachineOff.
#include "Motion86.h"
// Produce machine parts, up to machine 0~2 three machines, three axes per machine.
Machine machine(0);
// 步進馬達 enable pin。
int EnablePin = 4;
void setup() {
while (!Serial);
pinMode(EnablePin, OUTPUT);
// PPU (pulse per unit) is a virtual length unit, depending on the requirements.
// The unit length of the x-axis is set to 80 pulses, which corresponds to 1 mm for actual application.
machine.config_PPU(AXIS_X, 80.0);
machine.config_PPU(AXIS_Y, 80.0);
machine.config_PPU(AXIS_Z, 3200.0);
// Before control, the machine must be started.
machine.machineOn();
machine.setDefaultFeedrate(400);
// Start the stepper motor.
digitalWrite(EnablePin, LOW);
machine.line(10, 10, 0);
// We should turn off the machine before config it.
machine.machineOff();
// If necessary, the direction of motion of the motion axis can be reversed.
// In this example, it is necessary to reverse the direction of the x-axis and y-axis.
machine.config_ReverseDirection(AXIS_X);
machine.config_ReverseDirection(AXIS_Y);
// Before control, the machine must be started.
machine.machineOn();
machine.line(20, 20, 0);
}
void loop() {
}参照
ライブラリリファレンスホーム
86Duinoリファレンスのテキストは、Arduinoリファレンスを改変したもので、Creative Commons Attribution-ShareAlike 3.0ライセンスに基づいてライセンスされています。リファレンス内のコードサンプルはパブリックドメインとして公開されています。