up2date
This commit is contained in:
@@ -12,10 +12,11 @@
|
|||||||
|
|
||||||
#include "BluefruitConfig.h"
|
#include "BluefruitConfig.h"
|
||||||
|
|
||||||
#define BT_SCAN_MS 200
|
#define REQUIRE_SERIAL true
|
||||||
#define MINIMUM_FIRMWARE_VERSION "0.7.0"
|
#define BT_SCAN_MS 200
|
||||||
#define FACTORYRESET_ENABLE 1
|
#define MIN_FIRMWARE "0.7.0"
|
||||||
#define DIM_FACTOR 50
|
#define FACTORYRESET true
|
||||||
|
#define DIM_FACTOR 50
|
||||||
|
|
||||||
Adafruit_BluefruitLE_SPI ble(BLUEFRUIT_SPI_CS, BLUEFRUIT_SPI_IRQ, BLUEFRUIT_SPI_RST);
|
Adafruit_BluefruitLE_SPI ble(BLUEFRUIT_SPI_CS, BLUEFRUIT_SPI_IRQ, BLUEFRUIT_SPI_RST);
|
||||||
|
|
||||||
@@ -24,15 +25,15 @@ void bluetooth_setup(){
|
|||||||
Serial.println(F("Couldn't find Bluefruit, make sure it's in CoMmanD mode & check wiring?"));
|
Serial.println(F("Couldn't find Bluefruit, make sure it's in CoMmanD mode & check wiring?"));
|
||||||
while(1); // halt
|
while(1); // halt
|
||||||
}
|
}
|
||||||
if ( FACTORYRESET_ENABLE ) {
|
if ( FACTORYRESET ) {
|
||||||
if ( ! ble.factoryReset() ){
|
if ( ! ble.factoryReset() ){
|
||||||
Serial.println(F("Couldn't factory reset"));
|
Serial.println(F("Couldn't factory reset"));
|
||||||
while(1); // halt
|
while(1); // halt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( !ble.isVersionAtLeast(MINIMUM_FIRMWARE_VERSION) ){
|
if ( !ble.isVersionAtLeast(MIN_FIRMWARE) ){
|
||||||
Serial.print(F("Callback requires at least"));
|
Serial.print(F("Callback requires at least"));
|
||||||
Serial.println(F(MINIMUM_FIRMWARE_VERSION));
|
Serial.println(F(MIN_FIRMWARE));
|
||||||
while(1); // halt
|
while(1); // halt
|
||||||
}
|
}
|
||||||
pinMode(BLUEFRUIT_SPI_IRQ, INPUT_PULLUP);
|
pinMode(BLUEFRUIT_SPI_IRQ, INPUT_PULLUP);
|
||||||
@@ -162,9 +163,11 @@ class Strip {
|
|||||||
Strip strip = Strip(6, 144, 100);
|
Strip strip = Strip(6, 144, 100);
|
||||||
|
|
||||||
void setup(void) {
|
void setup(void) {
|
||||||
//strip.off()
|
strip.off();
|
||||||
while (!Serial); // required for Flora & Micro
|
if (REQUIRE_SERIAL){
|
||||||
Serial.begin(115200);
|
while (!Serial);
|
||||||
|
Serial.begin(115200);
|
||||||
|
}
|
||||||
bluetooth_setup();
|
bluetooth_setup();
|
||||||
Serial.println(F("Ready"));
|
Serial.println(F("Ready"));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user