Returns the state of the control port ()ctrl or an individual control pin on that port.
First control pin has index 1.
When index is omitted or set to -1, returns the complete control value.
planetcnc.hw_ctrl() planetcnc.hw_ctrl(index)
#! /usr/bin/env python import planetcnc # Get the complete control port state full_ctrl = planetcnc.hw_ctrl() print("Full Control State:", full_ctrl) # Get the state of the first control pin ctrl1 = planetcnc.hw_ctrl(1) print("Control pin 1 state:", ctrl1)