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