4

When you have a recursive function like this (one with too much depth potential), you need to convert it into a loop. In this case you have two functions alternating calling each other: while True: watchopen() watchclose() This will loop forever (as does the original version, you are exiting on a signal), but you can also use some kind of state as a ...


3

That's one way of doing it - it will work. The better way is to use GPIO.wait_for_edge(17, GPIO.RISING) which will pause at that line until the button is pressed (on a RISING or FALLING edge). However, BOARD numbering pin 17 is not a GPIO, it's 3V3. You could also use GPIO Zero which is more intuitive (and uses BCM numbering): from gpiozero import Button ...


2

After hours of hitting my head against the wall I tried to connect it directly without passing through the level shifter and it worked... I don't understand exactly why it is, I suppose it's because of the pulldown resistors or something like that but can tell exactly.


1

That sensor looks like it has an analogue output ! You would need an ADC (analogue to digital converter) to connect that correctly to a Pi. In this example, we will explain how to use a water sensor to detect the amount of water we have in a tank. We will use the S pin as analog input connecting Arduino, the value read will be higher depending on the ...


1

So, after digging some more and finding this article: https://forum.arduino.cc/index.php?topic=477085.0, it looks like the issue has to deal with interference somewhat. I decided to just run the third one on spi0 and things are working the way I want them to.


Only top voted, non community-wiki answers of a minimum length are eligible