infinityledclock/vscode/infclock/include/led_clockelements.hpp

50 lines
1.5 KiB
C++
Raw Normal View History

2020-02-25 13:30:38 +01:00
//#include <Arduino.h>
//#include "Adafruit_NeoPixel.h"
#include <FastLED.h>
typedef struct hue_color
{
uint8_t hue;
uint8_t sat;
uint8_t bright;
} hue_color;
2020-02-28 07:59:39 +01:00
2020-02-25 13:30:38 +01:00
class elements
{
private:
/* data */
2020-02-28 07:59:39 +01:00
#define FASTLEDDLY 1
2020-02-25 13:30:38 +01:00
#define BRIGHTNESS 128
#define SATURATION 255
public:
uint16_t element_first_pixel, element_last_pixel;
uint8_t element_number_pixels, elements_fraction;
hue_color elements_huecolor;
2020-05-19 01:45:07 +02:00
int32_t element_current_pixel = -1;
2020-02-25 13:30:38 +01:00
bool element_outside2inside = false;
CRGB *element_pixels;
void init(CRGB *pixels, unsigned int first_led, unsigned int number_leds, hue_color huecolor, bool outside2inside = false);
void test(uint8_t huecolor, uint8_t saturation = SATURATION, uint8_t brightness = BRIGHTNESS, bool all_at_once = false);
void test(hue_color huecolor, bool all_at_once = false);
void test( bool all_at_once = false);
2020-05-19 01:45:07 +02:00
void run_init();
void run(hue_color huecolor, bool to_outside);
2020-02-25 13:30:38 +01:00
void fill(uint8_t huecolor, uint8_t saturation = SATURATION, uint8_t brightness = BRIGHTNESS);
void fill(hue_color huecolor);
void fill(void);
void clean(void);
2020-02-28 07:59:39 +01:00
void ffill(unsigned int fraction, unsigned int fullvalue, uint8_t huecolor, uint8_t saturation = SATURATION, uint8_t brightness = BRIGHTNESS);
void ffill(unsigned int fraction, unsigned int fullvalue, hue_color huecolor);
void ffill(unsigned int fraction, unsigned int fullvalue);
void show(void);
2020-02-25 13:30:38 +01:00
};