6 files changed
+10
-11
No files matched your search
@@ -107,7 +107,6 @@ PIN_A6 LITERAL1
|
||||
PIN_A7 LITERAL1
|
||||
|
||||
PIN_AREF LITERAL1
|
||||
PIN_DFU LITERAL1
|
||||
PIN_NFC1 LITERAL1
|
||||
PIN_NFC2 LITERAL1
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
#include <Arduino.h>
|
||||
|
||||
uint32_t vbat_pin = PIN_VBAT; // A7 for feather nRF52832, A6 for nRF52840
|
||||
|
||||
#define VBAT_MV_PER_LSB (0.73242188F) // 3.0V ADC range and 12-bit ADC resolution = 3000mV/4096
|
||||
|
||||
#ifdef NRF52840_XXAA // if this is for nrf52840
|
||||
#define VBAT_PIN (A6)
|
||||
#define VBAT_DIVIDER (0.5F) // 150K + 150K voltage divider on VBAT
|
||||
#define VBAT_DIVIDER (0.5F) // 150K + 150K voltage divider on VBAT
|
||||
#define VBAT_DIVIDER_COMP (2.0F) // Compensation factor for the VBAT divider
|
||||
#else
|
||||
#define VBAT_PIN (A7)
|
||||
#define VBAT_DIVIDER (0.71275837F) // 2M + 0.806M voltage divider on VBAT = (2M / (0.806M + 2M))
|
||||
#define VBAT_DIVIDER_COMP (1.403F) // Compensation factor for the VBAT divider
|
||||
#endif
|
||||
@@ -27,7 +28,7 @@ float readVBAT(void) {
|
||||
delay(1);
|
||||
|
||||
// Get the raw 12-bit, 0..3000mV ADC value
|
||||
raw = analogRead(VBAT_PIN);
|
||||
raw = analogRead(vbat_pin);
|
||||
|
||||
// Set the ADC back to the default settings
|
||||
analogReference(AR_DEFAULT);
|
||||
|
||||
@@ -78,7 +78,7 @@ static const uint8_t A7 = PIN_A7 ;
|
||||
|
||||
// Other pins
|
||||
#define PIN_AREF (24)
|
||||
#define PIN_DFU (20)
|
||||
#define PIN_VBAT PIN_A7
|
||||
#define PIN_NFC1 (9)
|
||||
#define PIN_NFC2 (10)
|
||||
|
||||
|
||||
@@ -86,8 +86,8 @@ static const uint8_t A7 = PIN_A7 ;
|
||||
#define ADC_RESOLUTION 14
|
||||
|
||||
// Other pins
|
||||
#define PIN_AREF (PIN_A7)
|
||||
#define PIN_DFU (7)
|
||||
#define PIN_AREF PIN_A7
|
||||
#define PIN_VBAT PIN_A6
|
||||
#define PIN_NFC1 (33)
|
||||
#define PIN_NFC2 (2)
|
||||
|
||||
|
||||
@@ -86,8 +86,8 @@ static const uint8_t A7 = PIN_A7 ;
|
||||
#define ADC_RESOLUTION 14
|
||||
|
||||
// Other pins
|
||||
#define PIN_AREF (PIN_A7)
|
||||
#define PIN_DFU (7)
|
||||
#define PIN_AREF PIN_A7
|
||||
#define PIN_VBAT PIN_A6
|
||||
#define PIN_NFC1 (2)
|
||||
#define PIN_NFC2 (51)
|
||||
|
||||
|
||||
@@ -78,7 +78,6 @@ static const uint8_t A7 = PIN_A7 ;
|
||||
|
||||
// Other pins
|
||||
#define PIN_AREF (2)
|
||||
#define PIN_DFU (11)
|
||||
#define PIN_NFC1 (9)
|
||||
#define PIN_NFC2 (10)
|
||||
|
||||
|
||||
Reference in new issue
Block a user