Starting up accelerometer logging on boot
I am trying to teach Metawear C to log accelerometer readouts right after boot and I have troubles putting it correctly together.
The problem is with accelerometer and logging start commands. If I put them as in the code below, the logging never starts after reboot as if the continuation task is invisible to the macro. I need to connect to the board, run this code again and from this point logging starts working perfectly.
I tried two other alternatives... If I place accelerometer and logging start in Place A in the code, reboot the board, connect to it and dowload log all hell seems to break loose. I get lots of NullPointerExceptions from the board as if there is some thread race going on (understandable as I probably start logging before the route has been set up properly).
If I place acceloremeter and logging start in Place B in the code, reboot the board and connect to it and download the log it looks like the logging has started after reboot, but there is no acceloremeter data there. I download some data logged before reboot and then hundreds of empty log entries.
Do you have an idea how can I implement it properly?
This discussion has been closed.