Returns the state of the limit port or an individual limit switch on that port.
First limit switch has index 1.
When the index is omitted or set to -1, returns the entire limit value.
planetcnc.hw_limit() planetcnc.hw_limit(index)
#! /usr/bin/env python import planetcnc # Get the complete limit port state full_limit = planetcnc.hw_limit() print("Full Limit State:", full_limit) # Get the state of the first limit switch limit1 = planetcnc.hw_limit(1) print("Limit switch 1 state:", limit1)