Skip to content

Commit

Permalink
Added setLed
Browse files Browse the repository at this point in the history
  • Loading branch information
dave-hillier committed Jan 11, 2021
1 parent 8be6190 commit fbbf5e9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Bitcraze_PMW3901.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
2 changes: 2 additions & 0 deletions src/Bitcraze_PMW3901.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class Bitcraze_PMW3901 {
void enableFrameBuffer();
void readFrameBuffer(char *FBuffer);

void setLed(bool ledOn);

private:
uint8_t _cs;

Expand Down

0 comments on commit fbbf5e9

Please sign in to comment.