diff --git a/src/Bitcraze_PMW3901.cpp b/src/Bitcraze_PMW3901.cpp index 0bf91d8..b30f5fe 100644 --- a/src/Bitcraze_PMW3901.cpp +++ b/src/Bitcraze_PMW3901.cpp @@ -265,3 +265,11 @@ void Bitcraze_PMW3901::initRegisters() registerWrite(0x5A, 0x50); registerWrite(0x40, 0x80); } + +void Bitcraze_PMW3901::setLed(bool ledOn) +{ + delay(200); + registerWrite(0x7f, 0x14); + registerWrite(0x6f, ledOn ? 0x1c : 0x00); + registerWrite(0x7f, 0x00); +} diff --git a/src/Bitcraze_PMW3901.h b/src/Bitcraze_PMW3901.h index 5b1e867..8ddab80 100644 --- a/src/Bitcraze_PMW3901.h +++ b/src/Bitcraze_PMW3901.h @@ -37,6 +37,8 @@ class Bitcraze_PMW3901 { void enableFrameBuffer(); void readFrameBuffer(char *FBuffer); + void setLed(bool ledOn); + private: uint8_t _cs;