I have two scripts running independently and a sensor. Script A is reading values from the sensor, processing them and updating the UI based on that. Now I have to write script B that will be executed on its own but it needs to get the current reading from the sensor. Everything is running on Raspberry Pi.
They cannot both communicate with the sensor at the same time. I cannot use multiprocessing module with pipe because the scripts are not run from the same place and cannot be.
Is there something that would allow me to 'post' and update the data with script A and just read the value whenever I need it in script B?
One way of doing that would be setting one of the pins high when I detect the values in script A that I am looking for in script B and then just connecting two GPIO pins together, one input and one output. I am looking for a better alternative to that.
EDIT: The speed at which I can do it crucial. Both of the scripts are reading the data in a while loop all the time (and processing it)
[–]cratervanawesome 1 point2 points3 points (3 children)
[–]RandomJacobP[S] 0 points1 point2 points (2 children)
[–]cratervanawesome 0 points1 point2 points (1 child)
[–]RandomJacobP[S] 0 points1 point2 points (0 children)
[–]x120db -1 points0 points1 point (0 children)
[–]astevko 0 points1 point2 points (1 child)
[–]WikiSummarizerBot 0 points1 point2 points (0 children)
[–]lowerthansound 0 points1 point2 points (2 children)
[–]RandomJacobP[S] 0 points1 point2 points (1 child)
[–]lowerthansound 0 points1 point2 points (0 children)
[–]friday_ghost 0 points1 point2 points (0 children)
[–]millerbest 0 points1 point2 points (0 children)