alright. just the input im looking for. perhaps you could point me in the right direction?And that was my point, you have code in the main loop that turns the LED on when the GPIO pin goes high but you haven't got any code that turns it off when the pin goes low, so it will never turn off once it has turned on.thats kinda the idea. when said "thing" rolls off the switch, light turns on. when said "thing" rolls back onto it and "sits" on the switch, led off.Also, in your main() function you check to see if the button is pressed and if it is you print the message and turn the LED on. Now think about what is going to happen when you release the button, your code doesn't do anything if the button isn't pressed so if the LED had been turned on it will stay on on.
Statistics: Posted by SgtKiLLx — Thu Feb 08, 2024 1:30 am