Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added public member function for setting sensitivity control #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Adafruit_CAP1188.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ void Adafruit_CAP1188::LEDpolarity(uint8_t x) {
writeRegister(CAP1188_LEDPOL, x);
}

void Adafruit_CAP1188::sensitivity(uint8_t x) {
if (x > 7){
return;
}
writeRegister(CAP1188_SENSCTRL, (x << 4) + B1111);
}

/*********************************************************************/

/**************************************************************************/
Expand Down
2 changes: 2 additions & 0 deletions Adafruit_CAP1188.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#define CAP1188_MAIN 0x00
#define CAP1188_MAIN_INT 0x01
#define CAP1188_LEDPOL 0x73
#define CAP1188_SENSCTRL 0x1F


class Adafruit_CAP1188 {
Expand All @@ -54,6 +55,7 @@ class Adafruit_CAP1188 {
void writeRegister(uint8_t reg, uint8_t value);
uint8_t touched(void);
void LEDpolarity(uint8_t x);
void sensitivity(uint8_t x);

private:
uint8_t spixfer(uint8_t x);
Expand Down