From 84539fecfc5cb5d0c9ff7c29325c1961892ed251 Mon Sep 17 00:00:00 2001 From: "ghassan.yousif" Date: Sun, 22 Mar 2020 00:58:38 +0300 Subject: [PATCH] putting bac the led strip library --- Firmware Code/KICKER_V2/KICKER_V2.ino | 36 +- Firmware Code/KICKER_V2/NPXL.ino | 542 ++++++++++++-------------- README.md | 14 +- 3 files changed, 278 insertions(+), 314 deletions(-) diff --git a/Firmware Code/KICKER_V2/KICKER_V2.ino b/Firmware Code/KICKER_V2/KICKER_V2.ino index 2fdd699..3053bda 100644 --- a/Firmware Code/KICKER_V2/KICKER_V2.ino +++ b/Firmware Code/KICKER_V2/KICKER_V2.ino @@ -39,8 +39,15 @@ #include #include #include - #include #include + #include +//====================================================== +// OVER THE AIR PROGRAMMING +//====================================================== +// #include +// #include +// #include +// #include //====================================================== // PUBLIC VARIABLES //====================================================== @@ -90,7 +97,7 @@ #define POWER_SETUP pinMode(POWER_PIN, OUTPUT) #define POWER_OFF digitalWrite(POWER_PIN, LOW) #define POWER_ON digitalWrite(POWER_PIN, HIGH) - TimeTrigger POWER_PRESS(4000); // The Interval In mSeconds + TimeTrigger POWER_PRESS(4000); // The Interval In mSeconds //------------------------------------------------------ // Piezo Transducer //------------------------------------------------------ @@ -114,10 +121,12 @@ //------------------------------------------------------ // Neo Pixel LED Strip //------------------------------------------------------ - #define PIXEL_COUNT 21 // make sure to set this to the number of pixels in your strip - #define PIXEL_PIN 26 // make sure to set this to the correct pin, ignored for Esp8266 - // three element pixels, in different order and speeds - NeoPixelBus PIXEL_STRIP(PIXEL_COUNT, PIXEL_PIN); + #ifdef __AVR__ + #include // Required for 16 MHz Adafruit Trinket + #endif + #define PIN 6 // On Trinket or Gemma, suggest changing this to 1 + #define NUMPIXELS 16 // Number Of LED's + Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); //------------------------------------------------------ // JSON Object & Memory //------------------------------------------------------ @@ -157,12 +166,8 @@ // Power Hold POWER_SETUP; POWER_ON; - - // Turn On Booster - BOOST_SETUP; - BOOST_OFF; - - // Charging Status Pin + + // Charging Status Pin Setup STAT_SETUP; // I2C Module & OLED @@ -171,6 +176,13 @@ OLED_INIT(); OLED_CLEAR(); OLED_SHOW(); + + // IF Charger Connected Dont Allow Any One To Play + + + // Turn On Booster + BOOST_SETUP; + BOOST_ON; // Start Buttons Function BTN_PREVIOUS.begin(); diff --git a/Firmware Code/KICKER_V2/NPXL.ino b/Firmware Code/KICKER_V2/NPXL.ino index daa182f..2896415 100644 --- a/Firmware Code/KICKER_V2/NPXL.ino +++ b/Firmware Code/KICKER_V2/NPXL.ino @@ -1,295 +1,247 @@ -////====================================================== -//// NEO PIXEL LED STRIP -////====================================================== -//// PUBLIC DEFINITIONS -////------------------------------------------------------ -// #define BETWEEN_FADE 15 -// #define FADE_RATE 15 -// #define BLINK_RATE 250 -// #define ColorSaturation 128 -////------------------------------------------------------ -//// PURE COLOR -////------------------------------------------------------ -// RgbColor red(colorSaturation, 0, 0); -// RgbColor green(0, colorSaturation, 0); -// RgbColor blue(0, 0, colorSaturation); -// RgbColor white(colorSaturation); -// RgbColor black(0); -////------------------------------------------------------ -//// HSL COLOR -////------------------------------------------------------ -// HslColor hslRed(red); -// HslColor hslGreen(green); -// HslColor hslBlue(blue); -// HslColor hslWhite(white); -// HslColor hslBlack(black); -////------------------------------------------------------ -//// Clearing The LED Strip -////------------------------------------------------------ -// void LED_CLEAR() -// { -// // Make Sure Boost Is On -// BOOST_ON; -// -// // Clear The Strip Color -// PIXEL_STRIP.clear(); -// -// // Show On LED Strip -// LED_SHOW(); -// } -////------------------------------------------------------ -//// DISPLAY ON STRIP -////------------------------------------------------------ -// void LED_SHOW() -// { -// // Make Sure Boost Is On -// BOOST_ON; -// -// // Pass It To The LED Strip -// PIXEL_STRIP.show(); -// } -////------------------------------------------------------ -//// Set LED Brightness -////------------------------------------------------------ -// void LED_SET_BRIGHTNESS(uint8_t Value) -// { -// // Make Sure Boost Is On -// BOOST_ON; -// -// // Set The Brightness -// PIXEL_STRIP.setBrightness(Value); -// } -////------------------------------------------------------ -//// Set LED Color -////------------------------------------------------------ -// void LED_SET_COLOR(uint8_t R, uint8_t G, uint8_t B, uint8_t Intensity) -// { -// // Make Sure Boost Is On -// BOOST_ON; -// -// // Set Intensity -// LED_SET_BRIGHTNESS(Intensity); -// -// // Loop -// for(int i=0; i=0; i--) -// { -// PIXEL_STRIP.setBrightness(i); -// for(int j=0; j=0; i--) + { + PIXEL_STRIP.setBrightness(i); + for(int j=0; j