From 20a78270fb5a6b814c715eb2c94be75473e66f3c Mon Sep 17 00:00:00 2001 From: Brihi Date: Sat, 2 Sep 2017 12:39:55 +0530 Subject: [PATCH] Added comments --- i2c.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/i2c.js b/i2c.js index 25e8e87..e8a29bb 100644 --- a/i2c.js +++ b/i2c.js @@ -27,9 +27,9 @@ i2c.transfer(new Buffer([0x01]), 6, function (error, dataReceived) { //Create a blank array for the output var out=[]; - for (var i=0;i<3;i++){ + for (var i=0;i<3;i++){ //iterating for the x, y, z values - var gCount=(dataReceived[i*2] << 8) | dataReceived[(i*2)+1]; + var gCount=(dataReceived[i*2] << 8) | dataReceived[(i*2)+1]; //Converting the 8 bit data into a 12 bit gCount=gCount >> 4; if (dataReceived[i*2] > 0x7F) {