After about 10 seconds of mag readings (zero), I bring a magnet close to the puck. As expected the mag readings go up. Then I take the magnet away and the values go back down....a little. They do not go back down to the zero values that I would have expected.
So the open close door example does not work correctly because we never get back below 1000.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
After about 10 seconds of mag readings (zero), I bring a magnet close to the puck. As expected the mag readings go up. Then I take the magnet away and the values go back down....a little. They do not go back down to the zero values that I would have expected.
So the open close door example does not work correctly because we never get back below 1000.
1v91 Copyright 2016 G.Williams
41.49698784249
{ "x": -19, "y": 20, "z": 31 }
41.49698784249
108.59558002055
{ "x": -83, "y": 70, "z": -2 }
113.89907813498
{ "x": -84, "y": 74, "z": -21 }
115.32996141506
{ "x": -88, "y": 74, "z": -9 }
112.82730166054
{ "x": -88, "y": 69, "z": 15 }
112.29425630903
{ "x": -87, "y": 71, "z": 0 }
117.02136557056
{ "x": -93, "y": 71, "z": -2 }
8429.72300849796
{ "x": -5599, "y": -4602, "z": 4305 }
8429.72300849796
1419.88802375398
{ "x": -177, "y": -217, "z": 1392 }
1341.72426377404
{ "x": -80, "y": -140, "z": 1332 }
1317.90857042512
{ "x": -79, "y": -131, "z": 1309 }
1302.96623133525
{ "x": -73, "y": -134, "z": 1294 }
1320.38592843153
{ "x": -77, "y": -137, "z": 1311 }