34 lines
683 B
C++
34 lines
683 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <FastLED.h>
|
|
|
|
class PixelStompMux {
|
|
public:
|
|
static const uint8_t NUM_BUTTONS = 8;
|
|
static const uint8_t NUM_LEDS = 8;
|
|
|
|
PixelStompMux(uint8_t dat_pin, uint8_t ld_pin, uint8_t clk_pin, uint8_t di_pin);
|
|
|
|
void begin();
|
|
|
|
uint8_t read_buttons();
|
|
bool is_button_pressed(uint8_t index);
|
|
|
|
void set_led_color(uint8_t index, uint8_t r, uint8_t g, uint8_t b);
|
|
void set_led_brightness(uint8_t brightness);
|
|
void clear_all();
|
|
void show();
|
|
|
|
void dump();
|
|
void probe();
|
|
|
|
uint8_t pin_dat;
|
|
uint8_t pin_ld;
|
|
uint8_t pin_clk;
|
|
uint8_t pin_di;
|
|
|
|
CRGB leds[NUM_LEDS];
|
|
uint8_t last_button_state;
|
|
};
|