diff --git a/boards.txt b/boards.txt index 9105ef5e..bb35ea27 100644 --- a/boards.txt +++ b/boards.txt @@ -145,7 +145,7 @@ cplaynrf52840.build.core=nRF5 cplaynrf52840.build.variant=circuitplayground_nrf52840 cplaynrf52840.build.usb_manufacturer="Adafruit LLC" cplaynrf52840.build.usb_product="Adafruit Circuit Playground Bluefruit" -cplaynrf52840.build.extra_flags=-DNRF52840_XXAA -DARDUINO_NRF52_CIRCUITPLAY {build.flags.usb} +cplaynrf52840.build.extra_flags=-DNRF52840_XXAA -DARDUINO_NRF52840_CIRCUITPLAY {build.flags.usb} cplaynrf52840.build.ldscript=nrf52840_s140_v6.ld cplaynrf52840.build.vid=0x239A cplaynrf52840.build.pid=0x8045 diff --git a/libraries/Bluefruit52Lib/examples/Hardware/adc_vbat/adc_vbat.ino b/libraries/Bluefruit52Lib/examples/Hardware/adc_vbat/adc_vbat.ino index fb457598..86f59b3b 100644 --- a/libraries/Bluefruit52Lib/examples/Hardware/adc_vbat/adc_vbat.ino +++ b/libraries/Bluefruit52Lib/examples/Hardware/adc_vbat/adc_vbat.ino @@ -1,5 +1,9 @@ #include +#if defined ARDUINO_NRF52840_CIRCUITPLAY +#define PIN_VBAT A8 // this is just a mock read, we'll use the light sensor, so we can run the test +#endif + 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 @@ -77,4 +81,4 @@ void loop() { Serial.println("%)"); delay(1000); -} +} \ No newline at end of file diff --git a/libraries/Bluefruit52Lib/examples/Peripheral/ancs_oled/ancs_oled.ino b/libraries/Bluefruit52Lib/examples/Peripheral/ancs_oled/ancs_oled.ino index 10ee98ca..ea87f105 100644 --- a/libraries/Bluefruit52Lib/examples/Peripheral/ancs_oled/ancs_oled.ino +++ b/libraries/Bluefruit52Lib/examples/Peripheral/ancs_oled/ancs_oled.ino @@ -39,14 +39,17 @@ #define BUTTON_B 6 #define BUTTON_C 5 +#elif defined ARDUINO_NRF52840_CIRCUITPLAY +// Circuit Playground nRF52840 - FYI doesnt work probably because of button polarity! +#define BUTTON_A 4 // left button +#define BUTTON_B 7 // center switch +#define BUTTON_C 5 // right button + #else #error board not supported #endif - -#define OLED_RESET 4 // TODO remove ? -Adafruit_SSD1306 oled(OLED_RESET); - +Adafruit_SSD1306 oled(-1); /*------------- Notification List -------------*/ #define MAX_COUNT 20 @@ -453,4 +456,4 @@ uint32_t readPressedButtons(void) lastDebounced = debounced; return result; -} +} \ No newline at end of file diff --git a/libraries/Bluefruit52Lib/examples/Peripheral/image_upload/image_upload.ino b/libraries/Bluefruit52Lib/examples/Peripheral/image_upload/image_upload.ino index 3ccb0c74..db26cafa 100644 --- a/libraries/Bluefruit52Lib/examples/Peripheral/image_upload/image_upload.ino +++ b/libraries/Bluefruit52Lib/examples/Peripheral/image_upload/image_upload.ino @@ -26,12 +26,12 @@ BLEUart bleuart; // uart over ble /* The Image Transfer module sends the image of your choice to Bluefruit LE over UART. * Each image sent begins with - * - A single byte char “!â€� (0x21) + * - A single byte char “!” (0x21) * - Image width (uint16 little endian, 2 bytes) * - Image height (uint16 little endian, 2 bytes) * - Pixel data encoded as RGB 24-bit and suffixed by a single byte CRC. * - * Format: [ ‘!’ ] [ uint16 width ] [ uint16 height ] [ r g b ] [ r g b ] [ r g b ] … [ CRC ] + * Format: [ ‘!’ ] [ uint16 width ] [ uint16 height ] [ r g b ] [ r g b ] [ r g b ] … [ CRC ] */ uint16_t imageWidth = 0; @@ -45,17 +45,19 @@ uint32_t rxLastTime = 0; #ifdef ARDUINO_NRF52832_FEATHER #define TFT_DC 11 #define TFT_CS 31 - #define STMPE_CS 30 - #define SD_CS 27 #endif #ifdef ARDUINO_NRF52840_FEATHER #define TFT_DC 10 #define TFT_CS 9 - #define STMPE_CS 6 - #define SD_CS 5 #endif +#ifdef ARDUINO_NRF52840_CIRCUITPLAY + #define TFT_DC A7 + #define TFT_CS A6 +#endif + + Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC); void setup() @@ -199,4 +201,4 @@ void disconnect_callback(uint16_t conn_handle, uint8_t reason) tft.fillScreen(ILI9341_BLACK); tft.setCursor(0, 0); tft.println("Advertising ..."); -} +} \ No newline at end of file diff --git a/variants/circuitplayground_nrf52840/variant.h b/variants/circuitplayground_nrf52840/variant.h index ed04db84..7fe008fe 100644 --- a/variants/circuitplayground_nrf52840/variant.h +++ b/variants/circuitplayground_nrf52840/variant.h @@ -88,8 +88,8 @@ static const uint8_t A9 = PIN_A9 ; * Serial interfaces */ // Serial -#define PIN_SERIAL_RX (1) -#define PIN_SERIAL_TX (0) +#define PIN_SERIAL_RX (0) +#define PIN_SERIAL_TX (1) /* * SPI Interfaces