I'm re-writing all of my robot code to start actually using classes and because the current version is a mess of noob mistake and patches. I would like it to be full of slightly more advanced mistakes...
So ideally, my sensor class constructor could keep updating bunches of variables from various sources without me having to call to a device and wait for a response - Then I could just call a getVariable() function and the latest data is sitting there waiting for me. I am a little familiar with fork(), but I'm afraid this won't work because it won't be updating the correct set of variables or returning a pointer to the parent..or is there a way? I considered writing memory addresses to a file and reading the file from my parent program, but that doesn't feel like the right way to go. I must not be googling the correct terms either - got any direction for a fella?