Returns the state of the input port or an individual pin on that port.
First pin has index 1.
When the index is omitted or set to -1, returns the entire input value.
planetcnc.hw_input() planetcnc.hw_input(index)
#! /usr/bin/env python import planetcnc # Get the complete input port state full_input = planetcnc.hw_input() print("Full Input:", full_input) # Get the state of the first pin pin1_state = planetcnc.hw_input(1) print("Pin 1 state:", pin1_state)