Skip to content

Cycle button triggered on boot for some devices #19

Description

@thijstriemstra

Program:

#include <Arduino.h>
#include <FastLEDHub.h>

#include "Animations/Confetti.h"
#include "Animations/Color.h"
#include "Animations/Gradient.h"
#include "Animations/Rainbow.h"
#include "Animations/RGBWave.h"

#define CYCLE_BTN_PIN 10

#define NUM_LEDS 13
#define LIGHTSTRIP_PIN 9
#define LED_TYPE WS2812B

CRGB leds[NUM_LEDS];

void setup() {
  FastLEDHub.initialize("Nintendo");
  FastLEDHub.addLeds<LED_TYPE, LIGHTSTRIP_PIN, GRB>(leds, NUM_LEDS);

  FastLEDHub.registerAnimation(new Color("Color"));
  FastLEDHub.registerAnimation(new Gradient("Gradient"));
  FastLEDHub.registerAnimation(new Rainbow("Rainbow"));
  FastLEDHub.registerAnimation(new RGBWave("RGB Wave"));
  FastLEDHub.registerAnimation(new Confetti("Confetti"));

  FastLEDHub.registerSlider(new Slider("Saturation", 0, 255, 255, 1, "palette2"));

  FastLEDHub.registerColorPicker(new ColorPicker("Primary Color", CRGB(255, 0, 0)));
  FastLEDHub.registerColorPicker(new ColorPicker("Secondary Color", CRGB(0, 255, 0)));

  // cycle button
  FastLEDHub.enableCycleButton(CYCLE_BTN_PIN);
}

void loop() {
  FastLEDHub.handle();
}

I have the following config:

{
  "timeZone": 0,
  "summerTime": 0,
  "longitude": 0,
  "latitude": 0,
  "alarmEnabled": false,
  "alarmHour": 0,
  "alarmMinute": 0,
  "alarmDuration": 1,
  "alarmAnimation": "",
  "postAlarmAnimation": "",
  "sunsetEnabled": false,
  "sunsetHour": 18,
  "sunsetMinute": 6,
  "sunsetDuration": 1,
  "sunsetOffset": 0,
  "sunsetAnimation": "",
  "startupAnimation": "Gradient",
  "sliderValues": [
    255,
    252,
    255
  ],
  "colorPickerValues": [
    "3080ff",
    "8cffc2"
  ]
}

And these animations:

afbeelding

but restarting the device plays the wrong animation (Rainbow instead of Gradient). Same happens for the other animations, it's always index + 1 it seems.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions