I have a 11 switches who are one side connected to 5 Volt. The other side goes to pin 22-33 on the GiGa board. I want to flip the switch and in one perticullair order a L298 activates and is opening a lock. When all the switches are off again, a 12 th switch is lockling it up again by changing the polarity with the L298.
The problem is that when i read the pin, it is in on position always 1 and in the off position sometimes 1 and sometimes 0. So it is not 0 as i want it to be. I have programmed a INPUT_PULLUP, but that is not enough. Randomly 0 and 1 and then the program is not working. How can i make the hardware be always 0 when the switches are off and 1 when its on.
7 posts - 4 participants