I try to write a python-parent-script, that collects data from 4 child-scripts. What I got:
Every child-script reads data from a different sensor and they have to be read continiously. So what I do right now is read them in while True loops.
Different sensors have different response times, so one child-script is reading with a, lets say, once a second rate while another will read 100 times faster.
My goal/my struggle:
- Collect all the child-generated data in one script, in 4 different variables
What I acheved yet:
Child-scripts are doing there work fine and reading the data with no issues
I could start all 4 child-scripts from terminal as subprocesses but no idea how to collect ther generated data
Pass data between scripts but never from two scripts at the same time and way to slow, since the 'from script import variable' is as fast as the reading of the sensor.
Later plans are sending those 4 variables via Bluetooth to my phone, whitch I successed allready with only one sensor.
Since I am quite new to the whole Raspberry/Python community I would firstly say sorry for unspecific explenation. Please feel free to ask for further informations or suggest to solve things differently. And secondly I would appreceate it a lot if you could help me with code-snippets if you like, because again I am quite new and that helps me way more then links to librarys or documenturies that create more questions than answearing them.
Thank you a lot in advance