diff options
author | Daniel Friesel <derf@finalrewind.org> | 2018-06-01 21:03:44 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2018-06-01 21:03:44 +0200 |
commit | 84addb37b28afd72ab4ca60c1250c543f89a08c1 (patch) | |
tree | 6c6b1dce8e2f0a8ab867814bd80690cbd317d221 | |
parent | 4d6f31c761baa01ea3a643129ef2bfae09a68044 (diff) |
Describe hsv table generation
-rw-r--r-- | src/system.cc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/system.cc b/src/system.cc index a4b53fa..c532f34 100644 --- a/src/system.cc +++ b/src/system.cc @@ -36,13 +36,6 @@ System blinkencat; #define PWM_BLUE OCR0A /* -const uint8_t pwmtable[32] PROGMEM = { - 0, 1, 2, 2, 2, 3, 3, 4, 5, 6, 7, 8, 10, 11, 13, 16, 19, 23, - 27, 32, 38, 45, 54, 64, 76, 91, 108, 128, 152, 181, 215, 255 -}; -*/ - -/* // cos #define HSBTABLE_LEN 80 #define HSBTABLE_MAX (3*HSBTABLE_LEN) @@ -55,7 +48,10 @@ uint8_t const hsbtable[80] PROGMEM = { }; */ -// linear +/* + * Linear fading + * print([int(round(2**(np.log2(256) * (84-x) / 84) - 1)) for x in range(84)]) + */ #define HSBTABLE2_LEN 84 #define HSBTABLE2_MAX (3*HSBTABLE_LEN) uint8_t const hsbtable2[84] PROGMEM = { @@ -66,7 +62,10 @@ uint8_t const hsbtable2[84] PROGMEM = { 0, 0, 0, 0, 0 }; -// linear for non-powerconscious HSB +/* + * Linear fading for non-powerconscious HSB + * print([int(round(2**(np.log2(256) * (42-x) / 42) - 1)) for x in range(42)]) + */ #define HSBTABLE_LEN 42 #define HSBTABLE_MAX (6*HSBTABLE_LEN) uint8_t const hsbtable[42] PROGMEM = { |