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

Fixes problem when using a Mega2560 board where I had to do pin reass… #214

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Digital-Thor
Copy link

…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.)

…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.
@sandeepmistry
Copy link
Owner

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?

@Digital-Thor
Copy link
Author

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants