From 8a4d103196312b8a18afc0a2ba0fc13ff1a0b180 Mon Sep 17 00:00:00 2001 From: krolyxon Date: Mon, 8 Jun 2026 23:12:15 +0530 Subject: remove .pio --- .../examples/RGBWstrandtest/.esp8266.test.skip | 0 .../examples/RGBWstrandtest/.trinket.test.skip | 0 .../examples/RGBWstrandtest/RGBWstrandtest.ino | 177 --------------- .../examples/StrandtestArduinoBLE/.none.test.only | 0 .../StrandtestArduinoBLE/StrandtestArduinoBLE.ino | 231 -------------------- .../StrandtestArduinoBLECallback/.none.test.only | 0 .../StrandtestArduinoBLECallback.ino | 239 --------------------- .../examples/StrandtestBLE/.none.test.only | 0 .../examples/StrandtestBLE/BLESerial.cpp | 141 ------------ .../examples/StrandtestBLE/BLESerial.h | 53 ----- .../examples/StrandtestBLE/StrandtestBLE.ino | 192 ----------------- .../examples/StrandtestBLE_nodelay/.none.test.only | 1 - .../examples/StrandtestBLE_nodelay/BLESerial.cpp | 141 ------------ .../examples/StrandtestBLE_nodelay/BLESerial.h | 53 ----- .../StrandtestBLE_nodelay.ino | 198 ----------------- .../examples/buttoncycler/.esp8266.test.skip | 0 .../examples/buttoncycler/buttoncycler.ino | 164 -------------- .../examples/simple/.esp8266.test.skip | 0 .../Adafruit NeoPixel/examples/simple/simple.ino | 50 ----- .../simple_new_operator/.esp8266.test.skip | 0 .../simple_new_operator/simple_new_operator.ino | 67 ------ .../examples/strandtest/.esp8266.test.skip | 0 .../examples/strandtest/strandtest.ino | 143 ------------ .../examples/strandtest_nodelay/.esp8266.test.skip | 1 - .../strandtest_nodelay/strandtest_nodelay.ino | 200 ----------------- .../examples/strandtest_wheel/.esp8266.test.skip | 0 .../examples/strandtest_wheel/strandtest_wheel.ino | 134 ------------ 27 files changed, 2185 deletions(-) delete mode 100644 .pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/RGBWstrandtest/.esp8266.test.skip delete mode 100644 .pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/RGBWstrandtest/.trinket.test.skip delete mode 100644 .pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/RGBWstrandtest/RGBWstrandtest.ino delete mode 100644 .pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestArduinoBLE/.none.test.only delete mode 100644 .pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestArduinoBLE/StrandtestArduinoBLE.ino delete mode 100644 .pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestArduinoBLECallback/.none.test.only delete mode 100644 .pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestArduinoBLECallback/StrandtestArduinoBLECallback.ino delete mode 100644 .pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE/.none.test.only delete mode 100644 .pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE/BLESerial.cpp delete mode 100644 .pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE/BLESerial.h delete mode 100644 .pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE/StrandtestBLE.ino delete mode 100644 .pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE_nodelay/.none.test.only delete mode 100644 .pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE_nodelay/BLESerial.cpp delete mode 100644 .pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE_nodelay/BLESerial.h delete mode 100644 .pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE_nodelay/StrandtestBLE_nodelay.ino delete mode 100644 .pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/buttoncycler/.esp8266.test.skip delete mode 100644 .pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/buttoncycler/buttoncycler.ino delete mode 100644 .pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/simple/.esp8266.test.skip delete mode 100644 .pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/simple/simple.ino delete mode 100644 .pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/simple_new_operator/.esp8266.test.skip delete mode 100644 .pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/simple_new_operator/simple_new_operator.ino delete mode 100644 .pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/strandtest/.esp8266.test.skip delete mode 100644 .pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/strandtest/strandtest.ino delete mode 100644 .pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/strandtest_nodelay/.esp8266.test.skip delete mode 100644 .pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/strandtest_nodelay/strandtest_nodelay.ino delete mode 100644 .pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/strandtest_wheel/.esp8266.test.skip delete mode 100644 .pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/strandtest_wheel/strandtest_wheel.ino (limited to '.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples') diff --git a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/RGBWstrandtest/.esp8266.test.skip b/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/RGBWstrandtest/.esp8266.test.skip deleted file mode 100644 index e69de29..0000000 diff --git a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/RGBWstrandtest/.trinket.test.skip b/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/RGBWstrandtest/.trinket.test.skip deleted file mode 100644 index e69de29..0000000 diff --git a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/RGBWstrandtest/RGBWstrandtest.ino b/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/RGBWstrandtest/RGBWstrandtest.ino deleted file mode 100644 index 95335cd..0000000 --- a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/RGBWstrandtest/RGBWstrandtest.ino +++ /dev/null @@ -1,177 +0,0 @@ -// NeoPixel test program showing use of the WHITE channel for RGBW -// pixels only (won't look correct on regular RGB NeoPixel strips). - -#include -#ifdef __AVR__ - #include // Required for 16 MHz Adafruit Trinket -#endif - -// Which pin on the Arduino is connected to the NeoPixels? -// On a Trinket or Gemma we suggest changing this to 1: -#define LED_PIN 6 - -// How many NeoPixels are attached to the Arduino? -#define LED_COUNT 60 - -// NeoPixel brightness, 0 (min) to 255 (max) -#define BRIGHTNESS 50 // Set BRIGHTNESS to about 1/5 (max = 255) - -// Declare our NeoPixel strip object: -Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRBW + NEO_KHZ800); -// Argument 1 = Number of pixels in NeoPixel strip -// Argument 2 = Arduino pin number (most are valid) -// Argument 3 = Pixel type flags, add together as needed: -// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) -// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) -// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) -// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) -// NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products) - -void setup() { - // These lines are specifically to support the Adafruit Trinket 5V 16 MHz. - // Any other board, you can remove this part (but no harm leaving it): -#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000) - clock_prescale_set(clock_div_1); -#endif - // END of Trinket-specific code. - - strip.begin(); // INITIALIZE NeoPixel strip object (REQUIRED) - strip.show(); // Turn OFF all pixels ASAP - strip.setBrightness(BRIGHTNESS); -} - -void loop() { - // Fill along the length of the strip in various colors... - colorWipe(strip.Color(255, 0, 0) , 50); // Red - colorWipe(strip.Color( 0, 255, 0) , 50); // Green - colorWipe(strip.Color( 0, 0, 255) , 50); // Blue - colorWipe(strip.Color( 0, 0, 0, 255), 50); // True white (not RGB white) - - whiteOverRainbow(75, 5); - - pulseWhite(5); - - rainbowFade2White(3, 3, 1); -} - -// Fill strip pixels one after another with a color. Strip is NOT cleared -// first; anything there will be covered pixel by pixel. Pass in color -// (as a single 'packed' 32-bit value, which you can get by calling -// strip.Color(red, green, blue) as shown in the loop() function above), -// and a delay time (in milliseconds) between pixels. -void colorWipe(uint32_t color, int wait) { - for(int i=0; i= strip.numPixels()) whiteLength = strip.numPixels() - 1; - - int head = whiteLength - 1; - int tail = 0; - int loops = 3; - int loopNum = 0; - uint32_t lastTime = millis(); - uint32_t firstPixelHue = 0; - - for(;;) { // Repeat forever (or until a 'break' or 'return') - for(int i=0; i= tail) && (i <= head)) || // If between head & tail... - ((tail > head) && ((i >= tail) || (i <= head)))) { - strip.setPixelColor(i, strip.Color(0, 0, 0, 255)); // Set white - } else { // else set rainbow - int pixelHue = firstPixelHue + (i * 65536L / strip.numPixels()); - strip.setPixelColor(i, strip.gamma32(strip.ColorHSV(pixelHue))); - } - } - - strip.show(); // Update strip with new contents - // There's no delay here, it just runs full-tilt until the timer and - // counter combination below runs out. - - firstPixelHue += 40; // Advance just a little along the color wheel - - if((millis() - lastTime) > whiteSpeed) { // Time to update head/tail? - if(++head >= strip.numPixels()) { // Advance head, wrap around - head = 0; - if(++loopNum >= loops) return; - } - if(++tail >= strip.numPixels()) { // Advance tail, wrap around - tail = 0; - } - lastTime = millis(); // Save time of last movement - } - } -} - -void pulseWhite(uint8_t wait) { - for(int j=0; j<256; j++) { // Ramp up from 0 to 255 - // Fill entire strip with white at gamma-corrected brightness level 'j': - strip.fill(strip.Color(0, 0, 0, strip.gamma8(j))); - strip.show(); - delay(wait); - } - - for(int j=255; j>=0; j--) { // Ramp down from 255 to 0 - strip.fill(strip.Color(0, 0, 0, strip.gamma8(j))); - strip.show(); - delay(wait); - } -} - -void rainbowFade2White(int wait, int rainbowLoops, int whiteLoops) { - int fadeVal=0, fadeMax=100; - - // Hue of first pixel runs 'rainbowLoops' complete loops through the color - // wheel. Color wheel has a range of 65536 but it's OK if we roll over, so - // just count from 0 to rainbowLoops*65536, using steps of 256 so we - // advance around the wheel at a decent clip. - for(uint32_t firstPixelHue = 0; firstPixelHue < rainbowLoops*65536; - firstPixelHue += 256) { - - for(int i=0; i= ((rainbowLoops-1) * 65536)) { // Last loop, - if(fadeVal > 0) fadeVal--; // fade out - } else { - fadeVal = fadeMax; // Interim loop, make sure fade is at max - } - } - - for(int k=0; k=0; j--) { // Ramp down 255 to 0 - strip.fill(strip.Color(0, 0, 0, strip.gamma8(j))); - strip.show(); - } - } - - delay(500); // Pause 1/2 second -} diff --git a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestArduinoBLE/.none.test.only b/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestArduinoBLE/.none.test.only deleted file mode 100644 index e69de29..0000000 diff --git a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestArduinoBLE/StrandtestArduinoBLE.ino b/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestArduinoBLE/StrandtestArduinoBLE.ino deleted file mode 100644 index 80e02d2..0000000 --- a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestArduinoBLE/StrandtestArduinoBLE.ino +++ /dev/null @@ -1,231 +0,0 @@ -/**************************************************************************** - * This example is based on StrandtestBLE example and adapts it to use - * the new ArduinoBLE library. - * - * https://github.com/arduino-libraries/ArduinoBLE - * - * Supported boards: - * Arduino MKR WiFi 1010, Arduino Uno WiFi Rev2 board, Arduino Nano 33 IoT, - Arduino Nano 33 BLE, or Arduino Nano 33 BLE Sense board. - * - * You can use a generic BLE central app, like LightBlue (iOS and Android) or - * nRF Connect (Android), to interact with the services and characteristics - * created in this sketch. - * - * This example code is in the public domain. - * - */ -#include - -#define PIN 15 // Pin where NeoPixels are connected - -// Declare our NeoPixel strip object: -Adafruit_NeoPixel strip(64, PIN, NEO_GRB + NEO_KHZ800); -// Argument 1 = Number of pixels in NeoPixel strip -// Argument 2 = Arduino pin number (most are valid) -// Argument 3 = Pixel type flags, add together as needed: -// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) -// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) -// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) -// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) -// NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products) - -// NEOPIXEL BEST PRACTICES for most reliable operation: -// - Add 1000 uF CAPACITOR between NeoPixel strip's + and - connections. -// - MINIMIZE WIRING LENGTH between microcontroller board and first pixel. -// - NeoPixel strip's DATA-IN should pass through a 300-500 OHM RESISTOR. -// - AVOID connecting NeoPixels on a LIVE CIRCUIT. If you must, ALWAYS -// connect GROUND (-) first, then +, then data. -// - When using a 3.3V microcontroller with a 5V-powered NeoPixel strip, -// a LOGIC-LEVEL CONVERTER on the data line is STRONGLY RECOMMENDED. -// (Skipping these may work OK on your workbench but can fail in the field) - -uint8_t rgb_values[3]; - -#include - -BLEService ledService("19B10000-E8F2-537E-4F6C-D104768A1214"); // BLE LED Service - -// BLE LED Switch Characteristic - custom 128-bit UUID, read and writable by central -BLEByteCharacteristic switchCharacteristic("19B10001-E8F2-537E-4F6C-D104768A1214", BLERead | BLEWrite); - -void setup() -{ - Serial.begin(115200); - Serial.println("Hello World!"); - - // custom services and characteristics can be added as well - // begin initialization - if (!BLE.begin()) - { - Serial.println("starting BLE failed!"); - - while (1) - ; - } - - Serial.print("Peripheral address: "); - Serial.println(BLE.address()); - - // set advertised local name and service UUID: - BLE.setLocalName("LED"); - BLE.setAdvertisedService(ledService); - - // add the characteristic to the service - ledService.addCharacteristic(switchCharacteristic); - - // add service - BLE.addService(ledService); - - // set the initial value for the characeristic: - switchCharacteristic.writeValue(0); - - // start advertising - BLE.advertise(); - - strip.begin(); // INITIALIZE NeoPixel strip object (REQUIRED) - strip.show(); // Turn OFF all pixels ASAP - - pinMode(PIN, OUTPUT); - digitalWrite(PIN, LOW); - -} - -void loop() -{ - BLEDevice central = BLE.central(); - - // if a central is connected to peripheral: - if (central) - { - Serial.print("Connected to central: "); - // print the central's MAC address: - Serial.println(central.address()); - - // while the central is still connected to peripheral: - while (central.connected()) - { - // if the remote device wrote to the characteristic, - // use the value to control the LED: - if (switchCharacteristic.written()) - { - switch (switchCharacteristic.value()) - { - case 'a': - colorWipe(strip.Color(255, 0, 0), 20); // Red - break; - case 'b': - colorWipe(strip.Color(0, 255, 0), 20); // Green - break; - case 'c': - colorWipe(strip.Color(0, 0, 255), 20); // Blue - break; - case 'd': - theaterChase(strip.Color(255, 0, 0), 20); // Red - break; - case 'e': - theaterChase(strip.Color(0, 255, 0), 20); // Green - break; - case 'f': - theaterChase(strip.Color(255, 0, 255), 20); // Cyan - break; - case 'g': - rainbow(10); - break; - case 'h': - theaterChaseRainbow(20); - break; - } - } - } - } -} - -// Fill strip pixels one after another with a color. Strip is NOT cleared -// first; anything there will be covered pixel by pixel. Pass in color -// (as a single 'packed' 32-bit value, which you can get by calling -// strip.Color(red, green, blue) as shown in the loop() function above), -// and a delay time (in milliseconds) between pixels. -void colorWipe(uint32_t color, int wait) -{ - for (int i = 0; i < strip.numPixels(); i++) - { // For each pixel in strip... - strip.setPixelColor(i, color); // Set pixel's color (in RAM) - strip.show(); // Update strip to match - delay(wait); // Pause for a moment - } -} - -// Theater-marquee-style chasing lights. Pass in a color (32-bit value, -// a la strip.Color(r,g,b) as mentioned above), and a delay time (in ms) -// between frames. -void theaterChase(uint32_t color, int wait) -{ - for (int a = 0; a < 10; a++) - { // Repeat 10 times... - for (int b = 0; b < 3; b++) - { // 'b' counts from 0 to 2... - strip.clear(); // Set all pixels in RAM to 0 (off) - // 'c' counts up from 'b' to end of strip in steps of 3... - for (int c = b; c < strip.numPixels(); c += 3) - { - strip.setPixelColor(c, color); // Set pixel 'c' to value 'color' - } - strip.show(); // Update strip with new contents - delay(wait); // Pause for a moment - } - } -} - -// Rainbow cycle along whole strip. Pass delay time (in ms) between frames. -void rainbow(int wait) -{ - // Hue of first pixel runs 5 complete loops through the color wheel. - // Color wheel has a range of 65536 but it's OK if we roll over, so - // just count from 0 to 5*65536. Adding 256 to firstPixelHue each time - // means we'll make 5*65536/256 = 1280 passes through this outer loop: - for (long firstPixelHue = 0; firstPixelHue < 5 * 65536; firstPixelHue += 256) - { - for (int i = 0; i < strip.numPixels(); i++) - { // For each pixel in strip... - // Offset pixel hue by an amount to make one full revolution of the - // color wheel (range of 65536) along the length of the strip - // (strip.numPixels() steps): - int pixelHue = firstPixelHue + (i * 65536L / strip.numPixels()); - // strip.ColorHSV() can take 1 or 3 arguments: a hue (0 to 65535) or - // optionally add saturation and value (brightness) (each 0 to 255). - // Here we're using just the single-argument hue variant. The result - // is passed through strip.gamma32() to provide 'truer' colors - // before assigning to each pixel: - strip.setPixelColor(i, strip.gamma32(strip.ColorHSV(pixelHue))); - } - strip.show(); // Update strip with new contents - delay(wait); // Pause for a moment - } -} - -// Rainbow-enhanced theater marquee. Pass delay time (in ms) between frames. -void theaterChaseRainbow(int wait) -{ - int firstPixelHue = 0; // First pixel starts at red (hue 0) - for (int a = 0; a < 30; a++) - { // Repeat 30 times... - for (int b = 0; b < 3; b++) - { // 'b' counts from 0 to 2... - strip.clear(); // Set all pixels in RAM to 0 (off) - // 'c' counts up from 'b' to end of strip in increments of 3... - for (int c = b; c < strip.numPixels(); c += 3) - { - // hue of pixel 'c' is offset by an amount to make one full - // revolution of the color wheel (range 65536) along the length - // of the strip (strip.numPixels() steps): - int hue = firstPixelHue + c * 65536L / strip.numPixels(); - uint32_t color = strip.gamma32(strip.ColorHSV(hue)); // hue -> RGB - strip.setPixelColor(c, color); // Set pixel 'c' to value 'color' - } - strip.show(); // Update strip with new contents - delay(wait); // Pause for a moment - firstPixelHue += 65536 / 90; // One cycle of color wheel over 90 frames - } - } -} diff --git a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestArduinoBLECallback/.none.test.only b/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestArduinoBLECallback/.none.test.only deleted file mode 100644 index e69de29..0000000 diff --git a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestArduinoBLECallback/StrandtestArduinoBLECallback.ino b/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestArduinoBLECallback/StrandtestArduinoBLECallback.ino deleted file mode 100644 index b986943..0000000 --- a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestArduinoBLECallback/StrandtestArduinoBLECallback.ino +++ /dev/null @@ -1,239 +0,0 @@ -/**************************************************************************** - * This example is based on StrandtestArduinoBLE example to make use of - * callbacks features of the ArduinoBLE library. - * - * https://github.com/arduino-libraries/ArduinoBLE - * - * Supported boards: - * Arduino MKR WiFi 1010, Arduino Uno WiFi Rev2 board, Arduino Nano 33 IoT, - Arduino Nano 33 BLE, or Arduino Nano 33 BLE Sense board. - * - * You can use a generic BLE central app, like LightBlue (iOS and Android) or - * nRF Connect (Android), to interact with the services and characteristics - * created in this sketch. - * - * This example code is in the public domain. - * - */ -#include - -#define PIN 15 // Pin where NeoPixels are connected - -// Declare our NeoPixel strip object: -Adafruit_NeoPixel strip(64, PIN, NEO_GRB + NEO_KHZ800); -// Argument 1 = Number of pixels in NeoPixel strip -// Argument 2 = Arduino pin number (most are valid) -// Argument 3 = Pixel type flags, add together as needed: -// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) -// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) -// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) -// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) -// NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products) - -// NEOPIXEL BEST PRACTICES for most reliable operation: -// - Add 1000 uF CAPACITOR between NeoPixel strip's + and - connections. -// - MINIMIZE WIRING LENGTH between microcontroller board and first pixel. -// - NeoPixel strip's DATA-IN should pass through a 300-500 OHM RESISTOR. -// - AVOID connecting NeoPixels on a LIVE CIRCUIT. If you must, ALWAYS -// connect GROUND (-) first, then +, then data. -// - When using a 3.3V microcontroller with a 5V-powered NeoPixel strip, -// a LOGIC-LEVEL CONVERTER on the data line is STRONGLY RECOMMENDED. -// (Skipping these may work OK on your workbench but can fail in the field) - -uint8_t rgb_values[3]; - -#include - -BLEService ledService("19B10000-E8F2-537E-4F6C-D104768A1214"); // BLE LED Service - -// BLE LED Switch Characteristic - custom 128-bit UUID, read and writable by central -BLEByteCharacteristic switchCharacteristic("19B10001-E8F2-537E-4F6C-D104768A1214", BLERead | BLEWrite); - -void setup() -{ - Serial.begin(115200); - Serial.println("Hello World!"); - - // custom services and characteristics can be added as well - // begin initialization - if (!BLE.begin()) - { - Serial.println("starting BLE failed!"); - - while (1) - ; - } - - Serial.print("Peripheral address: "); - Serial.println(BLE.address()); - - // set advertised local name and service UUID: - BLE.setLocalName("LEDCallback"); - BLE.setAdvertisedService(ledService); - - // add the characteristic to the service - ledService.addCharacteristic(switchCharacteristic); - - // add service - BLE.addService(ledService); - // assign event handlers for connected, disconnected to peripheral - BLE.setEventHandler(BLEConnected, blePeripheralConnectHandler); - BLE.setEventHandler(BLEDisconnected, blePeripheralDisconnectHandler); - - // assign event handlers for characteristic - switchCharacteristic.setEventHandler(BLEWritten, switchCharacteristicWritten); - // set the initial value for the characeristic: - switchCharacteristic.writeValue(0); - - // start advertising - BLE.advertise(); - - strip.begin(); // INITIALIZE NeoPixel strip object (REQUIRED) - strip.show(); // Turn OFF all pixels ASAP - - pinMode(PIN, OUTPUT); - digitalWrite(PIN, LOW); -} - -void loop() -{ - // poll for BLE events - BLE.poll(); -} - -void blePeripheralConnectHandler(BLEDevice central) -{ - // central connected event handler - Serial.print("Connected event, central: "); - Serial.println(central.address()); -} - -void blePeripheralDisconnectHandler(BLEDevice central) -{ - // central disconnected event handler - Serial.print("Disconnected event, central: "); - Serial.println(central.address()); -} - -void switchCharacteristicWritten(BLEDevice central, BLECharacteristic characteristic) -{ - // central wrote new value to characteristic, update LED - Serial.print("Characteristic event, written: "); - - switch (switchCharacteristic.value()) - { - case 'a': - colorWipe(strip.Color(255, 0, 0), 20); // Red - break; - case 'b': - colorWipe(strip.Color(0, 255, 0), 20); // Green - break; - case 'c': - colorWipe(strip.Color(0, 0, 255), 20); // Blue - break; - case 'd': - theaterChase(strip.Color(255, 0, 0), 20); // Red - break; - case 'e': - theaterChase(strip.Color(0, 255, 0), 20); // Green - break; - case 'f': - theaterChase(strip.Color(255, 0, 255), 20); // Cyan - break; - case 'g': - rainbow(10); - break; - case 'h': - theaterChaseRainbow(20); - break; - } -} - -// Fill strip pixels one after another with a color. Strip is NOT cleared -// first; anything there will be covered pixel by pixel. Pass in color -// (as a single 'packed' 32-bit value, which you can get by calling -// strip.Color(red, green, blue) as shown in the loop() function above), -// and a delay time (in milliseconds) between pixels. -void colorWipe(uint32_t color, int wait) -{ - for (int i = 0; i < strip.numPixels(); i++) - { // For each pixel in strip... - strip.setPixelColor(i, color); // Set pixel's color (in RAM) - strip.show(); // Update strip to match - delay(wait); // Pause for a moment - } -} - -// Theater-marquee-style chasing lights. Pass in a color (32-bit value, -// a la strip.Color(r,g,b) as mentioned above), and a delay time (in ms) -// between frames. -void theaterChase(uint32_t color, int wait) -{ - for (int a = 0; a < 10; a++) - { // Repeat 10 times... - for (int b = 0; b < 3; b++) - { // 'b' counts from 0 to 2... - strip.clear(); // Set all pixels in RAM to 0 (off) - // 'c' counts up from 'b' to end of strip in steps of 3... - for (int c = b; c < strip.numPixels(); c += 3) - { - strip.setPixelColor(c, color); // Set pixel 'c' to value 'color' - } - strip.show(); // Update strip with new contents - delay(wait); // Pause for a moment - } - } -} - -// Rainbow cycle along whole strip. Pass delay time (in ms) between frames. -void rainbow(int wait) -{ - // Hue of first pixel runs 5 complete loops through the color wheel. - // Color wheel has a range of 65536 but it's OK if we roll over, so - // just count from 0 to 5*65536. Adding 256 to firstPixelHue each time - // means we'll make 5*65536/256 = 1280 passes through this outer loop: - for (long firstPixelHue = 0; firstPixelHue < 5 * 65536; firstPixelHue += 256) - { - for (int i = 0; i < strip.numPixels(); i++) - { // For each pixel in strip... - // Offset pixel hue by an amount to make one full revolution of the - // color wheel (range of 65536) along the length of the strip - // (strip.numPixels() steps): - int pixelHue = firstPixelHue + (i * 65536L / strip.numPixels()); - // strip.ColorHSV() can take 1 or 3 arguments: a hue (0 to 65535) or - // optionally add saturation and value (brightness) (each 0 to 255). - // Here we're using just the single-argument hue variant. The result - // is passed through strip.gamma32() to provide 'truer' colors - // before assigning to each pixel: - strip.setPixelColor(i, strip.gamma32(strip.ColorHSV(pixelHue))); - } - strip.show(); // Update strip with new contents - delay(wait); // Pause for a moment - } -} - -// Rainbow-enhanced theater marquee. Pass delay time (in ms) between frames. -void theaterChaseRainbow(int wait) -{ - int firstPixelHue = 0; // First pixel starts at red (hue 0) - for (int a = 0; a < 30; a++) - { // Repeat 30 times... - for (int b = 0; b < 3; b++) - { // 'b' counts from 0 to 2... - strip.clear(); // Set all pixels in RAM to 0 (off) - // 'c' counts up from 'b' to end of strip in increments of 3... - for (int c = b; c < strip.numPixels(); c += 3) - { - // hue of pixel 'c' is offset by an amount to make one full - // revolution of the color wheel (range 65536) along the length - // of the strip (strip.numPixels() steps): - int hue = firstPixelHue + c * 65536L / strip.numPixels(); - uint32_t color = strip.gamma32(strip.ColorHSV(hue)); // hue -> RGB - strip.setPixelColor(c, color); // Set pixel 'c' to value 'color' - } - strip.show(); // Update strip with new contents - delay(wait); // Pause for a moment - firstPixelHue += 65536 / 90; // One cycle of color wheel over 90 frames - } - } -} diff --git a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE/.none.test.only b/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE/.none.test.only deleted file mode 100644 index e69de29..0000000 diff --git a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE/BLESerial.cpp b/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE/BLESerial.cpp deleted file mode 100644 index 20d2a0c..0000000 --- a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE/BLESerial.cpp +++ /dev/null @@ -1,141 +0,0 @@ -#include "BLESerial.h" - -// #define BLE_SERIAL_DEBUG - -BLESerial *BLESerial::_instance = NULL; - -BLESerial::BLESerial(unsigned char req, unsigned char rdy, unsigned char rst) - : BLEPeripheral(req, rdy, rst) { - this->_txCount = 0; - this->_rxHead = this->_rxTail = 0; - this->_flushed = 0; - BLESerial::_instance = this; - - addAttribute(this->_uartService); - addAttribute(this->_uartNameDescriptor); - setAdvertisedServiceUuid(this->_uartService.uuid()); - addAttribute(this->_rxCharacteristic); - addAttribute(this->_rxNameDescriptor); - this->_rxCharacteristic.setEventHandler(BLEWritten, BLESerial::_received); - addAttribute(this->_txCharacteristic); - addAttribute(this->_txNameDescriptor); -} - -void BLESerial::begin(...) { - BLEPeripheral::begin(); -#ifdef BLE_SERIAL_DEBUG - Serial.println(F("BLESerial::begin()")); -#endif -} - -void BLESerial::poll() { - if (millis() < this->_flushed + 100) { - BLEPeripheral::poll(); - } else { - flush(); - } -} - -void BLESerial::end() { - this->_rxCharacteristic.setEventHandler(BLEWritten, NULL); - this->_rxHead = this->_rxTail = 0; - flush(); - BLEPeripheral::disconnect(); -} - -int BLESerial::available(void) { - BLEPeripheral::poll(); - int retval = (this->_rxHead - this->_rxTail + sizeof(this->_rxBuffer)) % - sizeof(this->_rxBuffer); -#ifdef BLE_SERIAL_DEBUG - Serial.print(F("BLESerial::available() = ")); - Serial.println(retval); -#endif - return retval; -} - -int BLESerial::peek(void) { - BLEPeripheral::poll(); - if (this->_rxTail == this->_rxHead) - return -1; - uint8_t byte = this->_rxBuffer[this->_rxTail]; -#ifdef BLE_SERIAL_DEBUG - Serial.print(F("BLESerial::peek() = ")); - Serial.print((char)byte); - Serial.print(F(" 0x")); - Serial.println(byte, HEX); -#endif - return byte; -} - -int BLESerial::read(void) { - BLEPeripheral::poll(); - if (this->_rxTail == this->_rxHead) - return -1; - this->_rxTail = (this->_rxTail + 1) % sizeof(this->_rxBuffer); - uint8_t byte = this->_rxBuffer[this->_rxTail]; -#ifdef BLE_SERIAL_DEBUG - Serial.print(F("BLESerial::read() = ")); - Serial.print((char)byte); - Serial.print(F(" 0x")); - Serial.println(byte, HEX); -#endif - return byte; -} - -void BLESerial::flush(void) { - if (this->_txCount == 0) - return; - this->_txCharacteristic.setValue(this->_txBuffer, this->_txCount); - this->_flushed = millis(); - this->_txCount = 0; - BLEPeripheral::poll(); -#ifdef BLE_SERIAL_DEBUG - Serial.println(F("BLESerial::flush()")); -#endif -} - -size_t BLESerial::write(uint8_t byte) { - BLEPeripheral::poll(); - if (this->_txCharacteristic.subscribed() == false) - return 0; - this->_txBuffer[this->_txCount++] = byte; - if (this->_txCount == sizeof(this->_txBuffer)) - flush(); -#ifdef BLE_SERIAL_DEBUG - Serial.print(F("BLESerial::write(")); - Serial.print((char)byte); - Serial.print(F(" 0x")); - Serial.print(byte, HEX); - Serial.println(F(") = 1")); -#endif - return 1; -} - -BLESerial::operator bool() { - bool retval = BLEPeripheral::connected(); -#ifdef BLE_SERIAL_DEBUG - Serial.print(F("BLESerial::operator bool() = ")); - Serial.println(retval); -#endif - return retval; -} - -void BLESerial::_received(const uint8_t *data, size_t size) { - for (int i = 0; i < size; i++) { - this->_rxHead = (this->_rxHead + 1) % sizeof(this->_rxBuffer); - this->_rxBuffer[this->_rxHead] = data[i]; - } -#ifdef BLE_SERIAL_DEBUG - Serial.print(F("BLESerial::received(")); - for (int i = 0; i < size; i++) - Serial.print((char)data[i]); - Serial.println(F(")")); -#endif -} - -void BLESerial::_received(BLECentral & /*central*/, - BLECharacteristic &rxCharacteristic) { - BLESerial::_instance->_received(rxCharacteristic.value(), - rxCharacteristic.valueLength()); -} diff --git a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE/BLESerial.h b/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE/BLESerial.h deleted file mode 100644 index 950bfb0..0000000 --- a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE/BLESerial.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef _BLE_SERIAL_H_ -#define _BLE_SERIAL_H_ - -#include -#include - -class BLESerial : public BLEPeripheral, public Stream { - public: - BLESerial(unsigned char req, unsigned char rdy, unsigned char rst); - - void begin(...); - void poll(); - void end(); - - virtual int available(void); - virtual int peek(void); - virtual int read(void); - virtual void flush(void); - virtual size_t write(uint8_t byte); - using Print::write; - virtual operator bool(); - - private: - unsigned long _flushed; - static BLESerial *_instance; - - size_t _rxHead; - size_t _rxTail; - size_t _rxCount() const; - uint8_t _rxBuffer[BLE_ATTRIBUTE_MAX_VALUE_LENGTH]; - size_t _txCount; - uint8_t _txBuffer[BLE_ATTRIBUTE_MAX_VALUE_LENGTH]; - - BLEService _uartService = - BLEService("6E400001-B5A3-F393-E0A9-E50E24DCCA9E"); - BLEDescriptor _uartNameDescriptor = BLEDescriptor("2901", "UART"); - BLECharacteristic _rxCharacteristic = BLECharacteristic( - "6E400002-B5A3-F393-E0A9-E50E24DCCA9E", BLEWriteWithoutResponse, - BLE_ATTRIBUTE_MAX_VALUE_LENGTH); - BLEDescriptor _rxNameDescriptor = - BLEDescriptor("2901", "RX - Receive Data (Write)"); - BLECharacteristic _txCharacteristic = - BLECharacteristic("6E400003-B5A3-F393-E0A9-E50E24DCCA9E", BLENotify, - BLE_ATTRIBUTE_MAX_VALUE_LENGTH); - BLEDescriptor _txNameDescriptor = - BLEDescriptor("2901", "TX - Transfer Data (Notify)"); - - void _received(const uint8_t *data, size_t size); - static void _received(BLECentral & /*central*/, - BLECharacteristic &rxCharacteristic); -}; - -#endif diff --git a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE/StrandtestBLE.ino b/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE/StrandtestBLE.ino deleted file mode 100644 index 593b35b..0000000 --- a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE/StrandtestBLE.ino +++ /dev/null @@ -1,192 +0,0 @@ -/**************************************************************************** - * This example was developed by the Hackerspace San Salvador to demonstrate - * the simultaneous use of the NeoPixel library and the Bluetooth SoftDevice. - * To compile this example you'll need to add support for the NRF52 based - * following the instructions at: - * https://github.com/sandeepmistry/arduino-nRF5 - * Or adding the following URL to the board manager URLs on Arduino preferences: - * https://sandeepmistry.github.io/arduino-nRF5/package_nRF5_boards_index.json - * Then you can install the BLEPeripheral library avaiable at: - * https://github.com/sandeepmistry/arduino-BLEPeripheral - * To test it, compile this example and use the UART module from the nRF - * Toolbox App for Android. Edit the interface and send the characters - * 'a' to 'i' to switch the animation. - * There is a delay because this example blocks the thread of execution but - * the change will be shown after the current animation ends. (This might - * take a couple of seconds) - * For more info write us at: info _at- teubi.co - */ -#include -#include -#include "BLESerial.h" -#include - -#define PIN 15 // Pin where NeoPixels are connected - -// Declare our NeoPixel strip object: -Adafruit_NeoPixel strip(64, PIN, NEO_GRB + NEO_KHZ800); -// Argument 1 = Number of pixels in NeoPixel strip -// Argument 2 = Arduino pin number (most are valid) -// Argument 3 = Pixel type flags, add together as needed: -// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) -// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) -// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) -// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) -// NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products) - -// NEOPIXEL BEST PRACTICES for most reliable operation: -// - Add 1000 uF CAPACITOR between NeoPixel strip's + and - connections. -// - MINIMIZE WIRING LENGTH between microcontroller board and first pixel. -// - NeoPixel strip's DATA-IN should pass through a 300-500 OHM RESISTOR. -// - AVOID connecting NeoPixels on a LIVE CIRCUIT. If you must, ALWAYS -// connect GROUND (-) first, then +, then data. -// - When using a 3.3V microcontroller with a 5V-powered NeoPixel strip, -// a LOGIC-LEVEL CONVERTER on the data line is STRONGLY RECOMMENDED. -// (Skipping these may work OK on your workbench but can fail in the field) - -// define pins (varies per shield/board) -#define BLE_REQ 10 -#define BLE_RDY 2 -#define BLE_RST 9 - -// create ble serial instance, see pinouts above -BLESerial BLESerial(BLE_REQ, BLE_RDY, BLE_RST); - -uint8_t current_state = 0; -uint8_t rgb_values[3]; - -void setup() { - Serial.begin(115200); - Serial.println("Hello World!"); - // custom services and characteristics can be added as well - BLESerial.setLocalName("UART_HS"); - BLESerial.begin(); - - strip.begin(); // INITIALIZE NeoPixel strip object (REQUIRED) - strip.show(); // Turn OFF all pixels ASAP - - //pinMode(PIN, OUTPUT); - //digitalWrite(PIN, LOW); - - current_state = 'a'; -} - -void loop() { - while(BLESerial.available()) { - uint8_t character = BLESerial.read(); - switch(character) { - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - current_state = character; - break; - }; - } - switch(current_state) { - case 'a': - colorWipe(strip.Color(255, 0, 0), 20); // Red - break; - case 'b': - colorWipe(strip.Color( 0, 255, 0), 20); // Green - break; - case 'c': - colorWipe(strip.Color( 0, 0, 255), 20); // Blue - break; - case 'd': - theaterChase(strip.Color(255, 0, 0), 20); // Red - break; - case 'e': - theaterChase(strip.Color( 0, 255, 0), 20); // Green - break; - case 'f': - theaterChase(strip.Color(255, 0, 255), 20); // Cyan - break; - case 'g': - rainbow(10); - break; - case 'h': - theaterChaseRainbow(20); - break; - } -} - -// Fill strip pixels one after another with a color. Strip is NOT cleared -// first; anything there will be covered pixel by pixel. Pass in color -// (as a single 'packed' 32-bit value, which you can get by calling -// strip.Color(red, green, blue) as shown in the loop() function above), -// and a delay time (in milliseconds) between pixels. -void colorWipe(uint32_t color, int wait) { - for(int i=0; i RGB - strip.setPixelColor(c, color); // Set pixel 'c' to value 'color' - } - strip.show(); // Update strip with new contents - delay(wait); // Pause for a moment - firstPixelHue += 65536 / 90; // One cycle of color wheel over 90 frames - } - } -} diff --git a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE_nodelay/.none.test.only b/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE_nodelay/.none.test.only deleted file mode 100644 index 8b13789..0000000 --- a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE_nodelay/.none.test.only +++ /dev/null @@ -1 +0,0 @@ - diff --git a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE_nodelay/BLESerial.cpp b/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE_nodelay/BLESerial.cpp deleted file mode 100644 index 20d2a0c..0000000 --- a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE_nodelay/BLESerial.cpp +++ /dev/null @@ -1,141 +0,0 @@ -#include "BLESerial.h" - -// #define BLE_SERIAL_DEBUG - -BLESerial *BLESerial::_instance = NULL; - -BLESerial::BLESerial(unsigned char req, unsigned char rdy, unsigned char rst) - : BLEPeripheral(req, rdy, rst) { - this->_txCount = 0; - this->_rxHead = this->_rxTail = 0; - this->_flushed = 0; - BLESerial::_instance = this; - - addAttribute(this->_uartService); - addAttribute(this->_uartNameDescriptor); - setAdvertisedServiceUuid(this->_uartService.uuid()); - addAttribute(this->_rxCharacteristic); - addAttribute(this->_rxNameDescriptor); - this->_rxCharacteristic.setEventHandler(BLEWritten, BLESerial::_received); - addAttribute(this->_txCharacteristic); - addAttribute(this->_txNameDescriptor); -} - -void BLESerial::begin(...) { - BLEPeripheral::begin(); -#ifdef BLE_SERIAL_DEBUG - Serial.println(F("BLESerial::begin()")); -#endif -} - -void BLESerial::poll() { - if (millis() < this->_flushed + 100) { - BLEPeripheral::poll(); - } else { - flush(); - } -} - -void BLESerial::end() { - this->_rxCharacteristic.setEventHandler(BLEWritten, NULL); - this->_rxHead = this->_rxTail = 0; - flush(); - BLEPeripheral::disconnect(); -} - -int BLESerial::available(void) { - BLEPeripheral::poll(); - int retval = (this->_rxHead - this->_rxTail + sizeof(this->_rxBuffer)) % - sizeof(this->_rxBuffer); -#ifdef BLE_SERIAL_DEBUG - Serial.print(F("BLESerial::available() = ")); - Serial.println(retval); -#endif - return retval; -} - -int BLESerial::peek(void) { - BLEPeripheral::poll(); - if (this->_rxTail == this->_rxHead) - return -1; - uint8_t byte = this->_rxBuffer[this->_rxTail]; -#ifdef BLE_SERIAL_DEBUG - Serial.print(F("BLESerial::peek() = ")); - Serial.print((char)byte); - Serial.print(F(" 0x")); - Serial.println(byte, HEX); -#endif - return byte; -} - -int BLESerial::read(void) { - BLEPeripheral::poll(); - if (this->_rxTail == this->_rxHead) - return -1; - this->_rxTail = (this->_rxTail + 1) % sizeof(this->_rxBuffer); - uint8_t byte = this->_rxBuffer[this->_rxTail]; -#ifdef BLE_SERIAL_DEBUG - Serial.print(F("BLESerial::read() = ")); - Serial.print((char)byte); - Serial.print(F(" 0x")); - Serial.println(byte, HEX); -#endif - return byte; -} - -void BLESerial::flush(void) { - if (this->_txCount == 0) - return; - this->_txCharacteristic.setValue(this->_txBuffer, this->_txCount); - this->_flushed = millis(); - this->_txCount = 0; - BLEPeripheral::poll(); -#ifdef BLE_SERIAL_DEBUG - Serial.println(F("BLESerial::flush()")); -#endif -} - -size_t BLESerial::write(uint8_t byte) { - BLEPeripheral::poll(); - if (this->_txCharacteristic.subscribed() == false) - return 0; - this->_txBuffer[this->_txCount++] = byte; - if (this->_txCount == sizeof(this->_txBuffer)) - flush(); -#ifdef BLE_SERIAL_DEBUG - Serial.print(F("BLESerial::write(")); - Serial.print((char)byte); - Serial.print(F(" 0x")); - Serial.print(byte, HEX); - Serial.println(F(") = 1")); -#endif - return 1; -} - -BLESerial::operator bool() { - bool retval = BLEPeripheral::connected(); -#ifdef BLE_SERIAL_DEBUG - Serial.print(F("BLESerial::operator bool() = ")); - Serial.println(retval); -#endif - return retval; -} - -void BLESerial::_received(const uint8_t *data, size_t size) { - for (int i = 0; i < size; i++) { - this->_rxHead = (this->_rxHead + 1) % sizeof(this->_rxBuffer); - this->_rxBuffer[this->_rxHead] = data[i]; - } -#ifdef BLE_SERIAL_DEBUG - Serial.print(F("BLESerial::received(")); - for (int i = 0; i < size; i++) - Serial.print((char)data[i]); - Serial.println(F(")")); -#endif -} - -void BLESerial::_received(BLECentral & /*central*/, - BLECharacteristic &rxCharacteristic) { - BLESerial::_instance->_received(rxCharacteristic.value(), - rxCharacteristic.valueLength()); -} diff --git a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE_nodelay/BLESerial.h b/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE_nodelay/BLESerial.h deleted file mode 100644 index 950bfb0..0000000 --- a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE_nodelay/BLESerial.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef _BLE_SERIAL_H_ -#define _BLE_SERIAL_H_ - -#include -#include - -class BLESerial : public BLEPeripheral, public Stream { - public: - BLESerial(unsigned char req, unsigned char rdy, unsigned char rst); - - void begin(...); - void poll(); - void end(); - - virtual int available(void); - virtual int peek(void); - virtual int read(void); - virtual void flush(void); - virtual size_t write(uint8_t byte); - using Print::write; - virtual operator bool(); - - private: - unsigned long _flushed; - static BLESerial *_instance; - - size_t _rxHead; - size_t _rxTail; - size_t _rxCount() const; - uint8_t _rxBuffer[BLE_ATTRIBUTE_MAX_VALUE_LENGTH]; - size_t _txCount; - uint8_t _txBuffer[BLE_ATTRIBUTE_MAX_VALUE_LENGTH]; - - BLEService _uartService = - BLEService("6E400001-B5A3-F393-E0A9-E50E24DCCA9E"); - BLEDescriptor _uartNameDescriptor = BLEDescriptor("2901", "UART"); - BLECharacteristic _rxCharacteristic = BLECharacteristic( - "6E400002-B5A3-F393-E0A9-E50E24DCCA9E", BLEWriteWithoutResponse, - BLE_ATTRIBUTE_MAX_VALUE_LENGTH); - BLEDescriptor _rxNameDescriptor = - BLEDescriptor("2901", "RX - Receive Data (Write)"); - BLECharacteristic _txCharacteristic = - BLECharacteristic("6E400003-B5A3-F393-E0A9-E50E24DCCA9E", BLENotify, - BLE_ATTRIBUTE_MAX_VALUE_LENGTH); - BLEDescriptor _txNameDescriptor = - BLEDescriptor("2901", "TX - Transfer Data (Notify)"); - - void _received(const uint8_t *data, size_t size); - static void _received(BLECentral & /*central*/, - BLECharacteristic &rxCharacteristic); -}; - -#endif diff --git a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE_nodelay/StrandtestBLE_nodelay.ino b/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE_nodelay/StrandtestBLE_nodelay.ino deleted file mode 100644 index 20c924d..0000000 --- a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/StrandtestBLE_nodelay/StrandtestBLE_nodelay.ino +++ /dev/null @@ -1,198 +0,0 @@ -/**************************************************************************** - * This example was developed by the Hackerspace San Salvador to demonstrate - * the simultaneous use of the NeoPixel library and the Bluetooth SoftDevice. - * To compile this example you'll need to add support for the NRF52 based - * following the instructions at: - * https://github.com/sandeepmistry/arduino-nRF5 - * Or adding the following URL to the board manager URLs on Arduino preferences: - * https://sandeepmistry.github.io/arduino-nRF5/package_nRF5_boards_index.json - * Then you can install the BLEPeripheral library avaiable at: - * https://github.com/sandeepmistry/arduino-BLEPeripheral - * To test it, compile this example and use the UART module from the nRF - * Toolbox App for Android. Edit the interface and send the characters - * 'a' to 'i' to switch the animation. - * There is a no delay because this example does not block the threads execution - * so the change will be shown immediately and will not need to wait for the current - * animation to end. - * For more info write us at: info _at- teubi.co - */ -#include -#include -#include "BLESerial.h" -#include - -#define PIN 15 // Pin where NeoPixels are connected - -// Declare our NeoPixel strip object: -Adafruit_NeoPixel strip(64, PIN, NEO_GRB + NEO_KHZ800); -// Argument 1 = Number of pixels in NeoPixel strip -// Argument 2 = Arduino pin number (most are valid) -// Argument 3 = Pixel type flags, add together as needed: -// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) -// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) -// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) -// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) -// NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products) - -// NEOPIXEL BEST PRACTICES for most reliable operation: -// - Add 1000 uF CAPACITOR between NeoPixel strip's + and - connections. -// - MINIMIZE WIRING LENGTH between microcontroller board and first pixel. -// - NeoPixel strip's DATA-IN should pass through a 300-500 OHM RESISTOR. -// - AVOID connecting NeoPixels on a LIVE CIRCUIT. If you must, ALWAYS -// connect GROUND (-) first, then +, then data. -// - When using a 3.3V microcontroller with a 5V-powered NeoPixel strip, -// a LOGIC-LEVEL CONVERTER on the data line is STRONGLY RECOMMENDED. -// (Skipping these may work OK on your workbench but can fail in the field) - -// define pins (varies per shield/board) -#define BLE_REQ 10 -#define BLE_RDY 2 -#define BLE_RST 9 - -// create ble serial instance, see pinouts above -BLESerial BLESerial(BLE_REQ, BLE_RDY, BLE_RST); - -uint8_t current_state = 0; -uint8_t rgb_values[3]; - -void setup() { - Serial.begin(115200); - Serial.println("Hello World!"); - // custom services and characteristics can be added as well - BLESerial.setLocalName("UART_HS"); - BLESerial.begin(); - - strip.begin(); // INITIALIZE NeoPixel strip object (REQUIRED) - strip.show(); // Turn OFF all pixels ASAP - - //pinMode(PIN, OUTPUT); - //digitalWrite(PIN, LOW); - - current_state = 'a'; -} - -void loop() { - while(BLESerial.available()) { - uint8_t character = BLESerial.read(); - switch(character) { - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - current_state = character; - break; - }; - } - switch(current_state) { - case 'a': - colorWipe(strip.Color(255, 0, 0), 20); // Red - break; - case 'b': - colorWipe(strip.Color( 0, 255, 0), 20); // Green - break; - case 'c': - colorWipe(strip.Color( 0, 0, 255), 20); // Blue - break; - case 'd': - theaterChase(strip.Color(255, 0, 0), 20); // Red - break; - case 'e': - theaterChase(strip.Color( 0, 255, 0), 20); // Green - break; - case 'f': - theaterChase(strip.Color(255, 0, 255), 20); // Cyan - break; - case 'g': - rainbow(10); - break; - case 'h': - theaterChaseRainbow(20); - break; - } -} - -// Some functions of our own for creating animated effects ----------------- - -// Fill strip pixels one after another with a color. Strip is NOT cleared -// first; anything there will be covered pixel by pixel. Pass in color -// (as a single 'packed' 32-bit value, which you can get by calling -// strip.Color(red, green, blue) as shown in the loop() function above), -// and a delay time (in milliseconds) between pixels. -void colorWipe(uint32_t color, int wait) { - if(pixelInterval != wait) - pixelInterval = wait; // Update delay time - strip.setPixelColor(pixelCurrent, color); // Set pixel's color (in RAM) - strip.show(); // Update strip to match - pixelCurrent++; // Advance current pixel - if(pixelCurrent >= pixelNumber) // Loop the pattern from the first LED - pixelCurrent = 0; -} - -// Theater-marquee-style chasing lights. Pass in a color (32-bit value, -// a la strip.Color(r,g,b) as mentioned above), and a delay time (in ms) -// between frames. -void theaterChase(uint32_t color, int wait) { - if(pixelInterval != wait) - pixelInterval = wait; // Update delay time - for(int i = 0; i < pixelNumber; i++) { - strip.setPixelColor(i + pixelQueue, color); // Set pixel's color (in RAM) - } - strip.show(); // Update strip to match - for(int i=0; i < pixelNumber; i+3) { - strip.setPixelColor(i + pixelQueue, strip.Color(0, 0, 0)); // Set pixel's color (in RAM) - } - pixelQueue++; // Advance current pixel - if(pixelQueue >= 3) - pixelQueue = 0; // Loop the pattern from the first LED -} - -// Rainbow cycle along whole strip. Pass delay time (in ms) between frames. -void rainbow(uint8_t wait) { - if(pixelInterval != wait) - pixelInterval = wait; - for(uint16_t i=0; i < pixelNumber; i++) { - strip.setPixelColor(i, Wheel((i + pixelCycle) & 255)); // Update delay time - } - strip.show(); // Update strip to match - pixelCycle++; // Advance current cycle - if(pixelCycle >= 256) - pixelCycle = 0; // Loop the cycle back to the begining -} - -//Theatre-style crawling lights with rainbow effect -void theaterChaseRainbow(uint8_t wait) { - if(pixelInterval != wait) - pixelInterval = wait; // Update delay time - for(int i=0; i < pixelNumber; i+3) { - strip.setPixelColor(i + pixelQueue, Wheel((i + pixelCycle) % 255)); // Update delay time - } - strip.show(); - for(int i=0; i < pixelNumber; i+3) { - strip.setPixelColor(i + pixelQueue, strip.Color(0, 0, 0)); // Update delay time - } - pixelQueue++; // Advance current queue - pixelCycle++; // Advance current cycle - if(pixelQueue >= 3) - pixelQueue = 0; // Loop - if(pixelCycle >= 256) - pixelCycle = 0; // Loop -} - -// Input a value 0 to 255 to get a color value. -// The colours are a transition r - g - b - back to r. -uint32_t Wheel(byte WheelPos) { - WheelPos = 255 - WheelPos; - if(WheelPos < 85) { - return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3); - } - if(WheelPos < 170) { - WheelPos -= 85; - return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3); - } - WheelPos -= 170; - return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0); -} diff --git a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/buttoncycler/.esp8266.test.skip b/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/buttoncycler/.esp8266.test.skip deleted file mode 100644 index e69de29..0000000 diff --git a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/buttoncycler/buttoncycler.ino b/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/buttoncycler/buttoncycler.ino deleted file mode 100644 index f6d87ed..0000000 --- a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/buttoncycler/buttoncycler.ino +++ /dev/null @@ -1,164 +0,0 @@ -// Simple demonstration on using an input device to trigger changes on your -// NeoPixels. Wire a momentary push button to connect from ground to a -// digital IO pin. When the button is pressed it will change to a new pixel -// animation. Initial state has all pixels off -- press the button once to -// start the first animation. As written, the button does not interrupt an -// animation in-progress, it works only when idle. - -#include -#ifdef __AVR__ - #include // Required for 16 MHz Adafruit Trinket -#endif - -// Digital IO pin connected to the button. This will be driven with a -// pull-up resistor so the switch pulls the pin to ground momentarily. -// On a high -> low transition the button press logic will execute. -#define BUTTON_PIN 2 - -#define PIXEL_PIN 6 // Digital IO pin connected to the NeoPixels. - -#define PIXEL_COUNT 16 // Number of NeoPixels - -// Declare our NeoPixel strip object: -Adafruit_NeoPixel strip(PIXEL_COUNT, PIXEL_PIN, NEO_GRB + NEO_KHZ800); -// Argument 1 = Number of pixels in NeoPixel strip -// Argument 2 = Arduino pin number (most are valid) -// Argument 3 = Pixel type flags, add together as needed: -// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) -// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) -// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) -// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) -// NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products) - -boolean oldState = HIGH; -int mode = 0; // Currently-active animation mode, 0-9 - -void setup() { - pinMode(BUTTON_PIN, INPUT_PULLUP); - strip.begin(); // Initialize NeoPixel strip object (REQUIRED) - strip.show(); // Initialize all pixels to 'off' -} - -void loop() { - // Get current button state. - boolean newState = digitalRead(BUTTON_PIN); - - // Check if state changed from high to low (button press). - if((newState == LOW) && (oldState == HIGH)) { - // Short delay to debounce button. - delay(20); - // Check if button is still low after debounce. - newState = digitalRead(BUTTON_PIN); - if(newState == LOW) { // Yes, still low - if(++mode > 8) mode = 0; // Advance to next mode, wrap around after #8 - switch(mode) { // Start the new animation... - case 0: - colorWipe(strip.Color( 0, 0, 0), 50); // Black/off - break; - case 1: - colorWipe(strip.Color(255, 0, 0), 50); // Red - break; - case 2: - colorWipe(strip.Color( 0, 255, 0), 50); // Green - break; - case 3: - colorWipe(strip.Color( 0, 0, 255), 50); // Blue - break; - case 4: - theaterChase(strip.Color(127, 127, 127), 50); // White - break; - case 5: - theaterChase(strip.Color(127, 0, 0), 50); // Red - break; - case 6: - theaterChase(strip.Color( 0, 0, 127), 50); // Blue - break; - case 7: - rainbow(10); - break; - case 8: - theaterChaseRainbow(50); - break; - } - } - } - - // Set the last-read button state to the old state. - oldState = newState; -} - -// Fill strip pixels one after another with a color. Strip is NOT cleared -// first; anything there will be covered pixel by pixel. Pass in color -// (as a single 'packed' 32-bit value, which you can get by calling -// strip.Color(red, green, blue) as shown in the loop() function above), -// and a delay time (in milliseconds) between pixels. -void colorWipe(uint32_t color, int wait) { - for(int i=0; i RGB - strip.setPixelColor(c, color); // Set pixel 'c' to value 'color' - } - strip.show(); // Update strip with new contents - delay(wait); // Pause for a moment - firstPixelHue += 65536 / 90; // One cycle of color wheel over 90 frames - } - } -} diff --git a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/simple/.esp8266.test.skip b/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/simple/.esp8266.test.skip deleted file mode 100644 index e69de29..0000000 diff --git a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/simple/simple.ino b/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/simple/simple.ino deleted file mode 100644 index 09f458e..0000000 --- a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/simple/simple.ino +++ /dev/null @@ -1,50 +0,0 @@ -// NeoPixel Ring simple sketch (c) 2013 Shae Erisson -// Released under the GPLv3 license to match the rest of the -// Adafruit NeoPixel library - -#include -#ifdef __AVR__ - #include // Required for 16 MHz Adafruit Trinket -#endif - -// Which pin on the Arduino is connected to the NeoPixels? -#define PIN 6 // On Trinket or Gemma, suggest changing this to 1 - -// How many NeoPixels are attached to the Arduino? -#define NUMPIXELS 16 // Popular NeoPixel ring size - -// When setting up the NeoPixel library, we tell it how many pixels, -// and which pin to use to send signals. Note that for older NeoPixel -// strips you might need to change the third parameter -- see the -// strandtest example for more information on possible values. -Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); - -#define DELAYVAL 500 // Time (in milliseconds) to pause between pixels - -void setup() { - // These lines are specifically to support the Adafruit Trinket 5V 16 MHz. - // Any other board, you can remove this part (but no harm leaving it): -#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000) - clock_prescale_set(clock_div_1); -#endif - // END of Trinket-specific code. - - pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED) -} - -void loop() { - pixels.clear(); // Set all pixel colors to 'off' - - // The first NeoPixel in a strand is #0, second is 1, all the way up - // to the count of pixels minus one. - for(int i=0; i -#ifdef __AVR__ - #include // Required for 16 MHz Adafruit Trinket -#endif - -// Which pin on the Arduino is connected to the NeoPixels? -int pin = 6; // On Trinket or Gemma, suggest changing this to 1 - -// How many NeoPixels are attached to the Arduino? -int numPixels = 16; // Popular NeoPixel ring size - -// NeoPixel color format & data rate. See the strandtest example for -// information on possible values. -int pixelFormat = NEO_GRB + NEO_KHZ800; - -// Rather than declaring the whole NeoPixel object here, we just create -// a pointer for one, which we'll then allocate later... -Adafruit_NeoPixel *pixels; - -#define DELAYVAL 500 // Time (in milliseconds) to pause between pixels - -void setup() { - // These lines are specifically to support the Adafruit Trinket 5V 16 MHz. - // Any other board, you can remove this part (but no harm leaving it): -#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000) - clock_prescale_set(clock_div_1); -#endif - // END of Trinket-specific code. - - // Right about here is where we could read 'pin', 'numPixels' and/or - // 'pixelFormat' from EEPROM or a file on SD or whatever. This is a simple - // example and doesn't do that -- those variables are just set to fixed - // values at the top of this code -- but this is where it would happen. - - // Then create a new NeoPixel object dynamically with these values: - pixels = new Adafruit_NeoPixel(numPixels, pin, pixelFormat); - - // Going forward from here, code works almost identically to any other - // NeoPixel example, but instead of the dot operator on function calls - // (e.g. pixels.begin()), we instead use pointer indirection (->) like so: - pixels->begin(); // INITIALIZE NeoPixel strip object (REQUIRED) - // You'll see more of this in the loop() function below. -} - -void loop() { - pixels->clear(); // Set all pixel colors to 'off' - - // The first NeoPixel in a strand is #0, second is 1, all the way up - // to the count of pixels minus one. - for(int i=0; iColor() takes RGB values, from 0,0,0 up to 255,255,255 - // Here we're using a moderately bright green color: - pixels->setPixelColor(i, pixels->Color(0, 150, 0)); - - pixels->show(); // Send the updated pixel colors to the hardware. - - delay(DELAYVAL); // Pause before next pass through loop - } -} diff --git a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/strandtest/.esp8266.test.skip b/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/strandtest/.esp8266.test.skip deleted file mode 100644 index e69de29..0000000 diff --git a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/strandtest/strandtest.ino b/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/strandtest/strandtest.ino deleted file mode 100644 index f4554cc..0000000 --- a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/strandtest/strandtest.ino +++ /dev/null @@ -1,143 +0,0 @@ -// A basic everyday NeoPixel strip test program. - -// NEOPIXEL BEST PRACTICES for most reliable operation: -// - Add 1000 uF CAPACITOR between NeoPixel strip's + and - connections. -// - MINIMIZE WIRING LENGTH between microcontroller board and first pixel. -// - NeoPixel strip's DATA-IN should pass through a 300-500 OHM RESISTOR. -// - AVOID connecting NeoPixels on a LIVE CIRCUIT. If you must, ALWAYS -// connect GROUND (-) first, then +, then data. -// - When using a 3.3V microcontroller with a 5V-powered NeoPixel strip, -// a LOGIC-LEVEL CONVERTER on the data line is STRONGLY RECOMMENDED. -// (Skipping these may work OK on your workbench but can fail in the field) - -#include -#ifdef __AVR__ - #include // Required for 16 MHz Adafruit Trinket -#endif - -// Which pin on the Arduino is connected to the NeoPixels? -// On a Trinket or Gemma we suggest changing this to 1: -#define LED_PIN 6 - -// How many NeoPixels are attached to the Arduino? -#define LED_COUNT 60 - -// Declare our NeoPixel strip object: -Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800); -// Argument 1 = Number of pixels in NeoPixel strip -// Argument 2 = Arduino pin number (most are valid) -// Argument 3 = Pixel type flags, add together as needed: -// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) -// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) -// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) -// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) -// NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products) - - -// setup() function -- runs once at startup -------------------------------- - -void setup() { - // These lines are specifically to support the Adafruit Trinket 5V 16 MHz. - // Any other board, you can remove this part (but no harm leaving it): -#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000) - clock_prescale_set(clock_div_1); -#endif - // END of Trinket-specific code. - - strip.begin(); // INITIALIZE NeoPixel strip object (REQUIRED) - strip.show(); // Turn OFF all pixels ASAP - strip.setBrightness(50); // Set BRIGHTNESS to about 1/5 (max = 255) -} - - -// loop() function -- runs repeatedly as long as board is on --------------- - -void loop() { - // Fill along the length of the strip in various colors... - colorWipe(strip.Color(255, 0, 0), 50); // Red - colorWipe(strip.Color( 0, 255, 0), 50); // Green - colorWipe(strip.Color( 0, 0, 255), 50); // Blue - - // Do a theater marquee effect in various colors... - theaterChase(strip.Color(127, 127, 127), 50); // White, half brightness - theaterChase(strip.Color(127, 0, 0), 50); // Red, half brightness - theaterChase(strip.Color( 0, 0, 127), 50); // Blue, half brightness - - rainbow(10); // Flowing rainbow cycle along the whole strip - theaterChaseRainbow(50); // Rainbow-enhanced theaterChase variant -} - - -// Some functions of our own for creating animated effects ----------------- - -// Fill strip pixels one after another with a color. Strip is NOT cleared -// first; anything there will be covered pixel by pixel. Pass in color -// (as a single 'packed' 32-bit value, which you can get by calling -// strip.Color(red, green, blue) as shown in the loop() function above), -// and a delay time (in milliseconds) between pixels. -void colorWipe(uint32_t color, int wait) { - for(int i=0; i RGB - strip.setPixelColor(c, color); // Set pixel 'c' to value 'color' - } - strip.show(); // Update strip with new contents - delay(wait); // Pause for a moment - firstPixelHue += 65536 / 90; // One cycle of color wheel over 90 frames - } - } -} diff --git a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/strandtest_nodelay/.esp8266.test.skip b/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/strandtest_nodelay/.esp8266.test.skip deleted file mode 100644 index 8b13789..0000000 --- a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/strandtest_nodelay/.esp8266.test.skip +++ /dev/null @@ -1 +0,0 @@ - diff --git a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/strandtest_nodelay/strandtest_nodelay.ino b/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/strandtest_nodelay/strandtest_nodelay.ino deleted file mode 100644 index 1fb8888..0000000 --- a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/strandtest_nodelay/strandtest_nodelay.ino +++ /dev/null @@ -1,200 +0,0 @@ -// A non-blocking everyday NeoPixel strip test program. - -// NEOPIXEL BEST PRACTICES for most reliable operation: -// - Add 1000 uF CAPACITOR between NeoPixel strip's + and - connections. -// - MINIMIZE WIRING LENGTH between microcontroller board and first pixel. -// - NeoPixel strip's DATA-IN should pass through a 300-500 OHM RESISTOR. -// - AVOID connecting NeoPixels on a LIVE CIRCUIT. If you must, ALWAYS -// connect GROUND (-) first, then +, then data. -// - When using a 3.3V microcontroller with a 5V-powered NeoPixel strip, -// a LOGIC-LEVEL CONVERTER on the data line is STRONGLY RECOMMENDED. -// (Skipping these may work OK on your workbench but can fail in the field) - -#include -#ifdef __AVR__ - #include // Required for 16 MHz Adafruit Trinket -#endif - -// Which pin on the Arduino is connected to the NeoPixels? -// On a Trinket or Gemma we suggest changing this to 1: -#ifdef ESP32 -// Cannot use 6 as output for ESP. Pins 6-11 are connected to SPI flash. Use 16 instead. -#define LED_PIN 16 -#else -#define LED_PIN 6 -#endif - -// How many NeoPixels are attached to the Arduino? -#define LED_COUNT 60 - -// Declare our NeoPixel strip object: -Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800); -// Argument 1 = Number of pixels in NeoPixel strip -// Argument 2 = Arduino pin number (most are valid) -// Argument 3 = Pixel type flags, add together as needed: -// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) -// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) -// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) -// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) -// NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products) - -unsigned long pixelPrevious = 0; // Previous Pixel Millis -unsigned long patternPrevious = 0; // Previous Pattern Millis -int patternCurrent = 0; // Current Pattern Number -int patternInterval = 5000; // Pattern Interval (ms) -bool patternComplete = false; - -int pixelInterval = 50; // Pixel Interval (ms) -int pixelQueue = 0; // Pattern Pixel Queue -int pixelCycle = 0; // Pattern Pixel Cycle -uint16_t pixelNumber = LED_COUNT; // Total Number of Pixels - -// setup() function -- runs once at startup -------------------------------- -void setup() { - // These lines are specifically to support the Adafruit Trinket 5V 16 MHz. - // Any other board, you can remove this part (but no harm leaving it): -#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000) - clock_prescale_set(clock_div_1); -#endif - // END of Trinket-specific code. - - strip.begin(); // INITIALIZE NeoPixel strip object (REQUIRED) - strip.show(); // Turn OFF all pixels ASAP - strip.setBrightness(50); // Set BRIGHTNESS to about 1/5 (max = 255) -} - -// loop() function -- runs repeatedly as long as board is on --------------- -void loop() { - unsigned long currentMillis = millis(); // Update current time - if( patternComplete || (currentMillis - patternPrevious) >= patternInterval) { // Check for expired time - patternComplete = false; - patternPrevious = currentMillis; - patternCurrent++; // Advance to next pattern - if(patternCurrent >= 7) - patternCurrent = 0; - } - - if(currentMillis - pixelPrevious >= pixelInterval) { // Check for expired time - pixelPrevious = currentMillis; // Run current frame - switch (patternCurrent) { - case 7: - theaterChaseRainbow(50); // Rainbow-enhanced theaterChase variant - break; - case 6: - rainbow(10); // Flowing rainbow cycle along the whole strip - break; - case 5: - theaterChase(strip.Color(0, 0, 127), 50); // Blue - break; - case 4: - theaterChase(strip.Color(127, 0, 0), 50); // Red - break; - case 3: - theaterChase(strip.Color(127, 127, 127), 50); // White - break; - case 2: - colorWipe(strip.Color(0, 0, 255), 50); // Blue - break; - case 1: - colorWipe(strip.Color(0, 255, 0), 50); // Green - break; - default: - colorWipe(strip.Color(255, 0, 0), 50); // Red - break; - } - } -} - -// Some functions of our own for creating animated effects ----------------- - -// Fill strip pixels one after another with a color. Strip is NOT cleared -// first; anything there will be covered pixel by pixel. Pass in color -// (as a single 'packed' 32-bit value, which you can get by calling -// strip.Color(red, green, blue) as shown in the loop() function above), -// and a delay time (in milliseconds) between pixels. -void colorWipe(uint32_t color, int wait) { - static uint16_t current_pixel = 0; - pixelInterval = wait; // Update delay time - strip.setPixelColor(current_pixel++, color); // Set pixel's color (in RAM) - strip.show(); // Update strip to match - if(current_pixel >= pixelNumber) { // Loop the pattern from the first LED - current_pixel = 0; - patternComplete = true; - } -} - -// Theater-marquee-style chasing lights. Pass in a color (32-bit value, -// a la strip.Color(r,g,b) as mentioned above), and a delay time (in ms) -// between frames. -void theaterChase(uint32_t color, int wait) { - static uint32_t loop_count = 0; - static uint16_t current_pixel = 0; - - pixelInterval = wait; // Update delay time - - strip.clear(); - - for(int c=current_pixel; c < pixelNumber; c += 3) { - strip.setPixelColor(c, color); - } - strip.show(); - - current_pixel++; - if (current_pixel >= 3) { - current_pixel = 0; - loop_count++; - } - - if (loop_count >= 10) { - current_pixel = 0; - loop_count = 0; - patternComplete = true; - } -} - -// Rainbow cycle along whole strip. Pass delay time (in ms) between frames. -void rainbow(uint8_t wait) { - if(pixelInterval != wait) - pixelInterval = wait; - for(uint16_t i=0; i < pixelNumber; i++) { - strip.setPixelColor(i, Wheel((i + pixelCycle) & 255)); // Update delay time - } - strip.show(); // Update strip to match - pixelCycle++; // Advance current cycle - if(pixelCycle >= 256) - pixelCycle = 0; // Loop the cycle back to the begining -} - -//Theatre-style crawling lights with rainbow effect -void theaterChaseRainbow(uint8_t wait) { - if(pixelInterval != wait) - pixelInterval = wait; // Update delay time - for(int i=0; i < pixelNumber; i+=3) { - strip.setPixelColor(i + pixelQueue, Wheel((i + pixelCycle) % 255)); // Update delay time - } - strip.show(); - for(int i=0; i < pixelNumber; i+=3) { - strip.setPixelColor(i + pixelQueue, strip.Color(0, 0, 0)); // Update delay time - } - pixelQueue++; // Advance current queue - pixelCycle++; // Advance current cycle - if(pixelQueue >= 3) - pixelQueue = 0; // Loop - if(pixelCycle >= 256) - pixelCycle = 0; // Loop -} - -// Input a value 0 to 255 to get a color value. -// The colours are a transition r - g - b - back to r. -uint32_t Wheel(byte WheelPos) { - WheelPos = 255 - WheelPos; - if(WheelPos < 85) { - return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3); - } - if(WheelPos < 170) { - WheelPos -= 85; - return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3); - } - WheelPos -= 170; - return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0); -} diff --git a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/strandtest_wheel/.esp8266.test.skip b/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/strandtest_wheel/.esp8266.test.skip deleted file mode 100644 index e69de29..0000000 diff --git a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/strandtest_wheel/strandtest_wheel.ino b/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/strandtest_wheel/strandtest_wheel.ino deleted file mode 100644 index c0ca41e..0000000 --- a/.pio/libdeps/esp32-s3-n16r8/Adafruit NeoPixel/examples/strandtest_wheel/strandtest_wheel.ino +++ /dev/null @@ -1,134 +0,0 @@ -#include -#ifdef __AVR__ - #include -#endif - -#define PIN 6 - -// Parameter 1 = number of pixels in strip -// Parameter 2 = Arduino pin number (most are valid) -// Parameter 3 = pixel type flags, add together as needed: -// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) -// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) -// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) -// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) -// NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products) -Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800); - -// IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across -// pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input -// and minimize distance between Arduino and first pixel. Avoid connecting -// on a live circuit...if you must, connect GND first. - -void setup() { - // This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket - #if defined (__AVR_ATtiny85__) - if (F_CPU == 16000000) clock_prescale_set(clock_div_1); - #endif - // End of trinket special code - - strip.begin(); - strip.setBrightness(50); - strip.show(); // Initialize all pixels to 'off' -} - -void loop() { - // Some example procedures showing how to display to the pixels: - colorWipe(strip.Color(255, 0, 0), 50); // Red - colorWipe(strip.Color(0, 255, 0), 50); // Green - colorWipe(strip.Color(0, 0, 255), 50); // Blue -//colorWipe(strip.Color(0, 0, 0, 255), 50); // White RGBW - // Send a theater pixel chase in... - theaterChase(strip.Color(127, 127, 127), 50); // White - theaterChase(strip.Color(127, 0, 0), 50); // Red - theaterChase(strip.Color(0, 0, 127), 50); // Blue - - rainbow(20); - rainbowCycle(20); - theaterChaseRainbow(50); -} - -// Fill the dots one after the other with a color -void colorWipe(uint32_t c, uint8_t wait) { - for(uint16_t i=0; i