Hi,
Using the Magnometer.ino I am trying to get any sensible readings from the Magnometer but I am just getting 0 on almost all axis except X axis where I get around -4 regardless of the direction Sparki is facing. Only with some stimuli like a magnet or metal object am I able to get any other readings out of it. The question is if my Magnometer is faulty or if it’s a generic problem?
I see a bug in the Magnometer code in the WireRead function in Sparki.cpp where it returns the buffer pointer which is declared within the function itself. This seem to result in some readings beeing of the scale (when the memory that the buffer is pointing to overwritten by som’ething else before it has been read out). However it seems to happen in some rare cases (every 10th read or so) which means it does not explain the issue I see and I have checked the rest of the code and it looks ok.