output()

Controls an output pin on the machine.

If called with one parameter, it toggles the pin state.
If called with two parameters, it sets the pin state explicitly.

Syntax

output(pin)
output(pin, state)

Parameters

Parameter Type Description
pin Number The output pin number to control.
state Number (Optional) `1` to turn on, `0` to turn off. optional

Return Value

Examples

Toggle output pin 5

output(5);  

Turn on output pin 3

output(3, 1);

Turn off output pin 7

output(7, 0);

See also

output
output_pwm
output_rc

mist
flood
spindle

extout1
extout2