Hallo!
ich habe ein Problem mit dem Sketch für Neopixel . Was ist das falsch, es wird immer define und ifdef bemängelt. Was muss ich da noch einstellen das Läuft wie bei „Mara“?
Den Sketch für den „Original Tonuino“ geht ohne Probleme Hochzuladen, mit den Bibliotheken.
Klassik Platine
/* DEV Version Barnosch LED Ring Mod - 28.11.2020 V2
Optional: 5 Tasten
Optional: LED Ring (24) MOD - FASTLED or NEOPIXEL
Optional: Zusätzliche StatusLED auf PIN 5
Extra LEDs für Lauter/Weiter und Leiser/Zurück
Orig DEV Version_Stand 12.5.2019 */
#include <DFMiniMp3.h>
#include <EEPROM.h>
#include <JC_Button.h>
#include <MFRC522.h>
#include <SPI.h>
#include <SoftwareSerial.h>
#include <avr/sleep.h>
/*
_____ _____ _____ _____ _____
|_ _|___ ___| | | | | | |
| | | . | | | |- -| | | | | |
|_| |___|_|_|_____|_____|_|___|_____|
TonUINO Version 2.1
created by Thorsten Voß and licensed under GNU/GPL.
Information and contribution at https://tonuino.de.
*/
static const uint32_t cardCookie = 322417479;
//#define FIVEBUTTONS // uncomment the line to enable five button support
#define STATUSLED // 1/2 uncomment the two lines to enable the StatusLED
#define statusLedPin 5 // 2/2 Pin für die Status LED
#define PLUSMINUS // 1/3 uncomment if no LED Buttons are used
#define louderLED 7 // 2/3 Pin für Louder/Next LED
#define lowerLED 8 // 3/3 Pin für Lower/Previous LED
// Please only enable one of the below LED Options
//#define LEDRING // uncomment the line to enable LED RING FASTLED support
define LED_SR // uncomment the line to enable LED RING NEOPIXEL support
#ifdef LEDRING // FastLED
#include <FastLED.h>
#define DATA_PIN 6
#define NUM_LEDS 24 // Anzahl der LEDs auf dem Ring
FASTLED_USING_NAMESPACE // FastLED define und Brightness
#define LED_TYPE WS2812
#define COLOR_ORDER GRB //RGB. Falls die Farben des Rings falsch angezeigt werden hier umstellen
CRGB leds[NUM_LEDS];
#define BRIGHTNESS1 3 // Helligkeit für FastLED Low (wenn z.B. KEINE Musik gespielt wird)
#define BRIGHTNESS2 30 // Helligkeit für FastLED High (wenn z.B Musik gespielt wird)
#define BRIGHTNESS3 50 // Helligkeit für FastLED bei Bestätigung z.B. Blinken o.ä.
#define BRIGHTNESS4 10
#define FRAMES_PER_SECOND 120
#endif
ifdef LED_SR // NeoPixel
include <Adafruit_NeoPixel.h>
define LED_PIN 6
define LED_COUNT 24
Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
// Zählvarbiablen
uint16_t loopCountdown; // Runterzählen der Loops
uint16_t lsrLoopCountWait; // Definierte Anzahl wieviele Loops runtergezählt werden sollen, also wie lange gewartet wird
uint8_t animationCountdown; // Wie oft die einmalige Animation ausgeführt wird bevor es zurück in die Hauptschleife (Animationsmodus 0) geht
uint8_t x;
uint8_t y;
uint8_t z;
uint8_t i;
// Datenvarbiablen
uint32_t lsrColorUp = strip.Color(0, 255, 0); // Farbe wird bei Animation nächstes Lied verwendet
uint32_t lsrColorDown = strip.Color(0, 0, 255); // Farbe wird bei Animation Lied zurück verwendet
uint8_t currentDetectedVolume; // Speichern der aktuellen Lautstärke für späteren Vergleich
uint8_t lastDetectedVolume; // Speichern der Lautstärke um die Animation nur ein mal zu triggern
uint8_t volumeScope; // Differenz der von euch eingestellten minimalen und maximalen Lautstärke
uint8_t volumeScopeAmount; // Lautstärkenwert in deinem Scope
uint8_t currentDetectedTrack; // Speichern des aktuellen Tracks für späteren Vergleich
uint8_t lastDetectedTrack; // Speichern des Tracks um die Animation nur ein mal zu triggern
uint8_t lsrAnimationMode; // Animationsmodus - 0: Daueranimation, 1-2 einmalige Animation (als Unterbrechung zu 0)
uint8_t lsrAnimationTrackMode; // Bei Animationsmodus Liedwechsel bestimmung der Farbe und Richtung
uint32_t lsrHueCalc; // Zwischenspeicher einer Farbe
uint32_t lsrColors; // Zwischenspeicher einer Farbe
uint8_t lsrColorR[LED_COUNT]; // Zwischenspeicher des Rot-Wertes für alle LEDs
uint8_t lsrColorG[LED_COUNT]; // Zwischenspeicher des Grün-Wertes für alle LEDs
uint8_t lsrColorB[LED_COUNT]; // Zwischenspeicher des Blau-Wertes für alle LEDs
endif
// DFPlayer Mini
SoftwareSerial mySoftwareSerial(2, 3); // RX, TX
uint16_t numTracksInFolder;
uint16_t currentTrack;
uint16_t firstTrack;
uint8_t queue[255];
uint8_t volume;
struct folderSettings {
uint8_t folder;
uint8_t mode;
uint8_t special;
uint8_t special2;
};
// this object stores nfc tag data
struct nfcTagObject {
uint32_t cookie;
uint8_t version;
folderSettings nfcFolderSettings;
// uint8_t folder;
// uint8_t mode;
// uint8_t special;
// uint8_t special2;
};
// admin settings stored in eeprom
struct adminSettings {
uint32_t cookie;
byte version;
uint8_t maxVolume;
uint8_t minVolume;
uint8_t initVolume;
uint8_t eq;
bool locked;
long standbyTimer;
bool invertVolumeButtons;
folderSettings shortCuts[4];
uint8_t adminMenuLocked;
uint8_t adminMenuPin[4];
};