Skip to content

Commit

Permalink
Merge pull request #13 from dave-hillier/master
Browse files Browse the repository at this point in the history
Control the LEDs
  • Loading branch information
ataffanel authored Jan 12, 2021
2 parents 8be6190 + fbbf5e9 commit 3ae7e5c
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 3ae7e5c

Please sign in to comment.