private void writeSerial(SerialCommandType command, Axis axis, Int32 positionToMoveTo) { if (command == SerialCommandType.Home) { if (axis == Axis.X) { writeOnSerial("G28 X"); } else if (axis == Axis.Y) { writeOnSerial("G28 Y"); } } else if (command == SerialCommandType.MoveTo) { if (axis == Axis.X) { String value = "G1 X" + positionToMoveTo / 10; writeOnSerial(value); } else if (axis == Axis.Y) { String value = "G1 Y" + positionToMoveTo / 10; writeOnSerial(value); } } }
private void writeSerial(SerialCommandType command, Axis axis, Int32 positionToMoveTo) { if (command == SerialCommandType.Home) { if (axis == Axis.X) { writeOnSerial("G28 X"); } else if (axis == Axis.Y) { writeOnSerial("G28 Y"); } } else if (command == SerialCommandType.MoveTo) { if (axis == Axis.X) { String value = "G1 X" + positionToMoveTo / 10; writeOnSerial(value); } else if (axis == Axis.Y) { String value = "G1 Y" + positionToMoveTo / 10; writeOnSerial(value); } } }