You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
2.2 KiB
82 lines
2.2 KiB
9 years ago
|
#pragma once
|
||
9 years ago
|
|
||
|
#include <Arduino.h>
|
||
9 years ago
|
#include "KeyboardConfig.h"
|
||
|
|
||
9 years ago
|
|
||
10 years ago
|
#define LED_MODES 7
|
||
10 years ago
|
#define LED_MODE_OFF 0
|
||
|
#define LED_MODE_STEADY 1
|
||
|
#define LED_MODE_BREATHE 2
|
||
|
#define LED_MODE_RAINBOW 3
|
||
10 years ago
|
#define LED_MODE_RAINBOW_WAVE 4
|
||
|
#define LED_MODE_HEATMAP 5
|
||
|
#define LED_MODE_CHASE 6
|
||
10 years ago
|
|
||
10 years ago
|
#define LED_SPECIAL_MODE_NUMLOCK 100
|
||
10 years ago
|
|
||
10 years ago
|
|
||
9 years ago
|
class LEDControl_ {
|
||
9 years ago
|
public:
|
||
9 years ago
|
LEDControl_(void);
|
||
9 years ago
|
void next_mode();
|
||
9 years ago
|
void boot_animation();
|
||
9 years ago
|
void update(uint8_t current_keymap);
|
||
9 years ago
|
void type_letter(uint8_t letter);
|
||
9 years ago
|
void set_mode(uint8_t mode);
|
||
9 years ago
|
|
||
|
private:
|
||
9 years ago
|
uint8_t led_mode = 0;
|
||
|
uint8_t last_led_mode = 0;
|
||
|
uint8_t stored_led_mode = 0;
|
||
9 years ago
|
uint8_t pos = 0;
|
||
9 years ago
|
void hsv_to_rgb(cRGB *cRGB, uint16_t h, uint16_t s, uint16_t v);
|
||
9 years ago
|
|
||
9 years ago
|
cRGB led_off;
|
||
|
cRGB led_steady;
|
||
|
cRGB led_blue;
|
||
|
cRGB led_dark_blue;
|
||
9 years ago
|
cRGB led_red;
|
||
|
cRGB led_dark_red;
|
||
9 years ago
|
cRGB led_breathe;
|
||
|
cRGB rainbow;
|
||
9 years ago
|
|
||
9 years ago
|
uint16_t rainbow_hue = 0; //stores 0 to 614
|
||
9 years ago
|
|
||
9 years ago
|
static const uint8_t rainbow_steps = 1; //number of hues we skip in a 360 range per update
|
||
|
static const uint8_t rainbow_wave_steps=1; //number of hues we skip in a 360 range per update
|
||
9 years ago
|
|
||
|
static const byte rainbow_saturation = 255;
|
||
9 years ago
|
static const byte rainbow_value = 255;
|
||
9 years ago
|
|
||
9 years ago
|
static const long rainbow_wave_ticks = 10; //delays between update
|
||
9 years ago
|
static const long rainbow_ticks = 5; //delays between update
|
||
9 years ago
|
long rainbow_current_ticks=0;
|
||
9 years ago
|
|
||
9 years ago
|
uint8_t breathe_brightness = 0; // how bright the LED is
|
||
|
int8_t breathe_fadeAmount=1; // how many points to fade the LED by (can be negative)
|
||
9 years ago
|
int8_t chase_sign =1; //negative values when it's going backwar
|
||
|
uint8_t chase_pixels=5;
|
||
9 years ago
|
uint8_t current_chase_counter = 0;
|
||
9 years ago
|
static const uint8_t chase_threshold = 20;
|
||
9 years ago
|
// End RGB stuff
|
||
|
void led_compute_breath();
|
||
9 years ago
|
void effect_breathe_init();
|
||
|
void effect_rainbow_init();
|
||
|
void effect_chase_init();
|
||
|
void effect_steady_init();
|
||
|
void effect_heatmap_init();
|
||
|
|
||
|
void effect_breathe_update();
|
||
|
void effect_rainbow_update();
|
||
|
void effect_rainbow_wave_update();
|
||
|
void effect_chase_update();
|
||
|
void effect_steady_update();
|
||
|
void effect_heatmap_update();
|
||
|
void effect_numlock_update();
|
||
9 years ago
|
void set_all_leds_to(cRGB color);
|
||
|
void initialize_led_mode(uint8_t mode);
|
||
9 years ago
|
};
|
||
|
|
||
9 years ago
|
extern LEDControl_ LEDControl;
|