Open Digital-Thor opened 6 years ago
What values were you using for PIN_REQ
and PIN_RST
? Where they past into the BLEHIDPeripheral
constructor as well?
Any way this can be fixed in the lib itself?
Below is my code snippet. Yes, it would probably be better to fix the problem upstream so that other dependencies benefit, but I'm not sure where/how to do that. Another option is that I could update the parent readme file.
// Mega Assignments
#define BUTTON_PIN 5
#define ENC_RIGHT_PIN 3
#define ENC_LEFT_PIN 4
#define PIN_REQ 10
#define PIN_RDY 2
#define PIN_RST 9
#define INPUT_POLL_INTERVAL 500
//#define ANDROID_CENTRAL
//custom boards may override default pin definitions with BLEHIDPeripheral(PIN_REQ, PIN_RDY, PIN_RST)
BLEHIDPeripheral bleHIDPeripheral = BLEHIDPeripheral(PIN_REQ, PIN_RDY, PIN_RST);
BLEMultimedia bleMultimedia;
Encoder encoder(ENC_RIGHT_PIN, ENC_LEFT_PIN);
int buttonState;
unsigned long lastInputPollTime = 0;
void setup() {
pinMode(PIN_REQ, OUTPUT);
pinMode(PIN_RST, OUTPUT);
Serial.begin(9600);
// etc...
…ignments to connect with NRF8001 Bluefruit LE. In that case the code kept restarting. I had to manually set pinMode to solve. This fix will also likely apply to other custom boards which don't use the standard Arduino-to-NRF8001 pin assignment. (Updates are only to in-line comments not code.)