diff --git a/README.md b/README.md new file mode 100644 index 0000000..8eebf63 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +A small webapp to read the sensors provided on modern mobile devices. + +On Android use the Firefox browser. diff --git a/sources/ambientLight.js b/sources/ambientLight.js index 6c86f1e..bd1e9d4 100644 --- a/sources/ambientLight.js +++ b/sources/ambientLight.js @@ -26,7 +26,7 @@ var ambientLightSource = (function(window) { lastVal = e.value; if (eventCounter == 5) { - var percentDiff = percentDifference(lastVal, e.value); + var percentDiff = Math.abs(percentDifference(lastVal, e.value)); //console.log('devicelight', lastVal, e.value, percentDiff)