File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,21 @@ uint8_t MT6835::getStatus(){
8888 return laststatus;
8989};
9090
91+ uint8_t MT6835::getCalibrationStatus (){
92+ uint8_t data[3 ] = {0 };
93+ data[0 ] = MT6835_OP_READ << 4 | MT6835_REG_CAL_STATUS >> 8 ;
94+ data[1 ] = MT6835_REG_CAL_STATUS;
95+
96+ spi->beginTransaction (settings);
97+ if (nCS >= 0 )
98+ digitalWrite (nCS, LOW);
99+ spi->transfer (data, 3 );
100+ if (nCS >= 0 )
101+ digitalWrite (nCS, HIGH);
102+ spi->endTransaction ();
103+
104+ return data[2 ] >> 6 ;
105+ }
91106
92107bool MT6835::setZeroFromCurrentPosition (){
93108 MT6835Command cmd;
Original file line number Diff line number Diff line change @@ -200,6 +200,8 @@ class MT6835 {
200200
201201 uint8_t getStatus ();
202202
203+ uint8_t getCalibrationStatus ();
204+
203205 bool setZeroFromCurrentPosition ();
204206 bool writeEEPROM (); // wait 6s after calling this method
205207
You can’t perform that action at this time.
0 commit comments