Merge branch 'master' into develop

libraries/Bluefruit52Lib/examples/Peripheral/image_upload/image_upload.ino
This commit is contained in:
hathach committed 2019-08-18 13:34:59 +07:00
commit dddb437355
10 files changed
+321 -22

No files matched your search

@@ -1,5 +1,9 @@
#include <Arduino.h>
#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);
}
}
@@ -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;
}
}
@@ -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;
@@ -49,15 +49,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
#else
#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()