Skip to content

Commit

Permalink
Added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
brihijoshi committed Sep 2, 2017
1 parent 002ef4b commit 20a7827
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions i2c.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 20a7827

Please sign in to comment.