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 @@ -55,6 +55,21 @@ uint8_t MT6835::getStatus(){
5555 return laststatus;
5656};
5757
58+ uint8_t MT6835::getCalibrationStatus (){
59+ uint8_t data[3 ] = {0 };
60+ data[0 ] = MT6835_OP_READ << 4 | MT6835_REG_CAL_STATUS >> 8 ;
61+ data[1 ] = MT6835_REG_CAL_STATUS;
62+
63+ spi->startTransaction (settings);
64+ if (nCS >= 0 )
65+ digitalWrite (nCS, LOW);
66+ spi->transfer (data, 3 );
67+ if (nCS >= 0 )
68+ digitalWrite (nCS, HIGH);
69+ spi->endTransaction ();
70+
71+ return data[2 ] >> 6 ;
72+ }
5873
5974bool MT6835::setZeroFromCurrentPosition (){
6075 MT6835Command cmd;
Original file line number Diff line number Diff line change @@ -199,6 +199,8 @@ class MT6835 {
199199
200200 uint8_t getStatus ();
201201
202+ uint8_t getCalibrationStatus ();
203+
202204 bool setZeroFromCurrentPosition ();
203205 bool writeEEPROM (); // wait 6s after calling this method
204206
You can’t perform that action at this time.
0 commit comments