Skip to content

Commit 6fec099

Browse files
authored
Update KX022.js
1 parent 4368d35 commit 6fec099

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

KX022.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ function LIS2MDL(options,r,w) {
2828
if (this.r(REG.WHO_AM_I,1)[0]!=20) throw new Error("WHO_AM_I incorrect");
2929
//this.w(REG.CNTL1, 0x50); //config 0 1 0 1 0 0 0 0 OLD
3030
this.w(REG.CNTL1, 0x10); //config 0 0 0 1 0 0 0 0 NEW
31+
var res = new DataView(this.r(REG.CNTL1,1).buffer);
32+
print(res.getInt8(0,1));
3133
//this.w(REG.CNTL1, 0xD0); //OLD
3234
this.w(REG.LP_CNTL, 0x0B); //NEW
3335
this.w(REG.CNTL1, 0x90); //NEW config 10010000
34-
print("config 1");
35-
var res = new DataView(this.r(REG.CNTL1,1).buffer);
36+
res = new DataView(this.r(REG.CNTL1,1).buffer);
3637
print(res.getInt8(0,1));
3738
// low pass filter, ODR/4
3839
//this.w(REG.CFG_B, 0x01);
@@ -49,7 +50,7 @@ LIS2MDL.prototype.init = function() {
4950
return {
5051
rslt: res.getInt8(0,1)
5152
};
52-
print(res.rslt);
53+
//print(res.rslt);
5354
};
5455

5556
//tt

0 commit comments

Comments
 (0)