I'd like to read the position of a switch. So, when a button is pushed, I get a Boolean that becomes true (or an integer that becomes 1). As soon as the button is released the values changes back to 'false' or 0.
My line of code so far goes like this :
ImpactSensLeft = (EzB_Connect1.EZB.Digital.GetDigitalPort(EZ_B.Digital.DigitalPortEnum.D15))
But this always returns 'true' doesn't really matter if the button gets pushed or whatever. What am I missing here ?
Where can I put this code for optimal results (form Load event ?? etc...). I want to read out and interact with the switch all the time while other code is processed. The switch acts as an emergency switch that shuts down the motors of my robot as soon as the switch is pushed. When released, the motors start running again.
I'm really looking forward to this.