Skip to content

Commit

Permalink
Update tut-i2c.md
Browse files Browse the repository at this point in the history
  • Loading branch information
brihijoshi authored Sep 11, 2017
1 parent 1e9d7c5 commit d8e0799
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tut-i2c.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ i2c.transfer(new Buffer([0x01]), 6, function (error, dataReceived) {
if (error) throw error;
//Create a blank array for the output
var out=[];
//iterating three times the x, y, z values
for (var i=0;i<3;i++) {
//iterating for the x, y, z values
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 d8e0799

Please sign in to comment.