output()

Start the machine.

Executes an output command to control a machine's output pin.

This function takes two integer arguments representing the pin number and the desired state, and then calls the underlying command to set the pin accordingly.

Syntax

planetcnc.output(pin, state)

Parameters

Parameter Type Description
pin int The output pin number to be controlled.
state bool The desired state for the specified pin.

Return Value

Examples

#! /usr/bin/env python 
 
import time
import planetcnc
 
state = True;
 
for i in range(5):
    res = planetcnc.output(1, state)
    if not res :
        print("Output command failed.")
        break
    time.sleep(1)
    state = not state

See also

estop
stop
pause
start
output
output_pwm
output_rc
open
close