Our team is using hall effect sensor to detect the position of our elevator

This picture should give a good picture of what we are trying to do.
I want to be able to use hall effect sensors to set the height of the elevator fork contraption to the height of one tote or 2 or 3. Using one hall effect sensor mounted on that elevator and mounting the magnets in proper places could work I think.
What I need to know is how to program the team 971 WCP hall effect sensors in java. I currently have a program that uses setpoint PIDSubsystems, but my code crashes when i use the button to set the setpoint. How do you guys go about using hall effect as sensors?