fix pin mapping in example for feather nrf52840
This commit is contained in:
1 parent
fbfb784e45
commit
6d10632e93
7 files changed
+24
-11
No files matched your search
@@ -109,12 +109,12 @@ bool HardwarePWM::addPin(uint8_t pin)
|
||||
if ( enabled() )
|
||||
{
|
||||
_pwm->ENABLE = 0;
|
||||
_pwm->PSEL.OUT[_count++] = pin;
|
||||
_pwm->PSEL.OUT[_count++] = g_ADigitalPinMap[pin];
|
||||
_pwm->ENABLE = 1;
|
||||
_start();
|
||||
}else
|
||||
{
|
||||
_pwm->PSEL.OUT[_count++] = pin;
|
||||
_pwm->PSEL.OUT[_count++] = g_ADigitalPinMap[pin];
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
*********************************************************************/
|
||||
|
||||
/*
|
||||
* This sketch demotrate how to pass ISR_DEFFERED as additional parameter
|
||||
* This sketch demonstrate how to pass ISR_DEFFERED as additional parameter
|
||||
* to defer callback from ISR context with attachInterrupt
|
||||
*/
|
||||
#include <Arduino.h>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include <bluefruit.h>
|
||||
|
||||
#define PIN_ADV 11
|
||||
#define PIN_ADV A0
|
||||
#define ADV_TIMEOUT 60 // seconds
|
||||
|
||||
void setup()
|
||||
|
||||
@@ -27,11 +27,24 @@
|
||||
#include <bluefruit.h>
|
||||
|
||||
/*------------- OLED and Buttons -------------*/
|
||||
#if defined ARDUINO_NRF52_FEATHER
|
||||
// Feather nRF52832
|
||||
#define BUTTON_A 31
|
||||
#define BUTTON_B 30
|
||||
#define BUTTON_C 27
|
||||
|
||||
#define OLED_RESET 4
|
||||
#elif defined ARDUINO_NRF52840_FEATHER
|
||||
// Feather nRF52840
|
||||
#define BUTTON_A 9
|
||||
#define BUTTON_B 6
|
||||
#define BUTTON_C 5
|
||||
|
||||
#else
|
||||
#error board not supported
|
||||
#endif
|
||||
|
||||
|
||||
#define OLED_RESET 4 // TODO remove ?
|
||||
Adafruit_SSD1306 oled(OLED_RESET);
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
BLEDis bledis;
|
||||
BLEHidAdafruit blehid;
|
||||
|
||||
#define PIN_SHUTTER 11
|
||||
#define PIN_SHUTTER A0
|
||||
|
||||
void setup()
|
||||
{
|
||||
|
||||
@@ -117,14 +117,14 @@ void startAdv(void)
|
||||
|
||||
void loop()
|
||||
{
|
||||
/*-------------- San Pin Array and send report ---------------------*/
|
||||
/*-------------- Scan Pin Array and send report ---------------------*/
|
||||
bool anyKeyPressed = false;
|
||||
|
||||
uint8_t modifier = 0;
|
||||
uint8_t count=0;
|
||||
uint8_t keycode[6] = { 0 };
|
||||
|
||||
// scan mofidier key (only SHIFT), user implement ATL, CTRL, CMD if needed
|
||||
// scan modifier key (only SHIFT), user implement ATL, CTRL, CMD if needed
|
||||
if ( 0 == digitalRead(shiftPin) )
|
||||
{
|
||||
modifier |= KEYBOARD_MODIFIER_LEFTSHIFT;
|
||||
|
||||
@@ -54,14 +54,14 @@ void HwRotaryEncoder::begin(uint8_t pina, uint8_t pinb, int8_t pinled)
|
||||
pinMode(pina, INPUT_PULLUP);
|
||||
pinMode(pinb, INPUT_PULLUP);
|
||||
|
||||
NRF_QDEC->PSEL.A = pina;
|
||||
NRF_QDEC->PSEL.B = pinb;
|
||||
NRF_QDEC->PSEL.A = g_ADigitalPinMap[pina];
|
||||
NRF_QDEC->PSEL.B = g_ADigitalPinMap[pinb];
|
||||
|
||||
if ( pinled >= 0 )
|
||||
{
|
||||
pinMode(pinled, INPUT);
|
||||
|
||||
NRF_QDEC->PSEL.LED = pinled;
|
||||
NRF_QDEC->PSEL.LED = g_ADigitalPinMap[pinled];
|
||||
}
|
||||
|
||||
// Disable debounce by default
|
||||
|
||||
Reference in new issue
Block a user