nanobad.blogg.se

Board press the red button
Board press the red button









board press the red button

GPIO_switch = 24 # select pin to connect button Does anyone know what the problem could be? And do I possibly need to change/add some code to the script that I want to run when the button is pushed? The code for the button and datalogger scripts are shown below. However when I press the button it allows the other script to create the CSV but when I press it again it doesn't seem to stop the script (the CSV isn't populated with data) and it creates a brand new CSV (also empty when pushed again etc). When the button is pushed it starts this script and when it is pushed again it is supposed to stop it cleanly (so the CSV is saved after the last write). My datalogger script creates a CSV file and then continuously writes data to it as long as it receives a square wave signal at the input pin. Then if I press it again I want the other script to start up again etc. Then when I press the button again it will stop the other script from running and exit safely.

board press the red button

So when the Pi is booted up I'm wanting the button script to run and then once I press the button it will start another python script. I've written some python code that should start and stop another python script (Datalogger) when a button is pressed.











Board press the red button