Object Model & Endstop Switches
-
Hello!
Wondering if it's possible to check the state of an endstop switch in the object model? Not whether an axis is homed, rather the specific state of the switch regardless of homed?
Cheers,
David -
use
echo sensors[x].endstops.triggered
where x= the number of the end stop;check all end stops echo #sensors.endstops ^ " endstops found" G4 S3; wait 3 seconds while iterations < #sensors.endstops echo "endstop-" ^ iterations ^ " Type= " ^ sensors.endstops[iterations].type ^ "state= " ^ sensors.endstops[iterations].triggered G4 S3; wait 3 seconds
output (read from bottom up)
4/8/2020, 7:53:44 PM endstop-2 Type= zProbeAsEndstopstate= true 4/8/2020, 7:53:41 PM endstop-1 Type= inputPinstate= false 4/8/2020, 7:53:38 PM endstop-0 Type= inputPinstate= true 4/8/2020, 7:53:35 PM M98 P"0:/macros/conditional g code macros/check_endstops.g" 3 endstops found
-
Lovely! Thank you!