-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjm_gamma8.spin2
93 lines (71 loc) · 4.02 KB
/
jm_gamma8.spin2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
'' =================================================================================================
''
'' File....... jm_gamma8.spin2
'' Purpose.... Gamma table for LED applications
'' Author..... Jon "JonnyMac" McPhalen
'' Copyright (C) 2018-2020 Jon McPhalen
'' -- see below for terms of use
'' E-mail..... [email protected]
'' Started....
'' Updated.... 09 JUN 2020
''
'' =================================================================================================
pub null()
'' This is not a top-level object
pub gamma(level) : result
return GammaTable[0 #> level <# 255]
pub address() : result
'' Returns hub address of brightness array
return @GammaTable
dat { gamma table }
' Liberated from an Adafruit WS2812 demo
GammaTable byte 0, 0, 0, 0, 0, 0, 0, 0
byte 0, 0, 0, 0, 0, 0, 0, 0
byte 0, 0, 0, 0, 0, 0, 0, 0
byte 1, 1, 1, 1, 1, 1, 1, 1
byte 1, 1, 1, 1, 2, 2, 2, 2
byte 2, 2, 2, 2, 3, 3, 3, 3
byte 3, 3, 4, 4, 4, 4, 5, 5
byte 5, 5, 5, 6, 6, 6, 6, 7
byte 7, 7, 8, 8, 8, 9, 9, 9
byte 10, 10, 10, 11, 11, 11, 12, 12
byte 13, 13, 13, 14, 14, 15, 15, 16
byte 16, 17, 17, 18, 18, 19, 19, 20
byte 20, 21, 21, 22, 22, 23, 24, 24
byte 25, 25, 26, 27, 27, 28, 29, 29
byte 30, 31, 31, 32, 33, 34, 34, 35
byte 36, 37, 38, 38, 39, 40, 41, 42
byte 42, 43, 44, 45, 46, 47, 48, 49
byte 50, 51, 52, 53, 54, 55, 56, 57
byte 58, 59, 60, 61, 62, 63, 64, 65
byte 66, 68, 69, 70, 71, 72, 73, 75
byte 76, 77, 78, 80, 81, 82, 84, 85
byte 86, 88, 89, 90, 92, 93, 94, 96
byte 97, 99, 100, 102, 103, 105, 106, 108
byte 109, 111, 112, 114, 115, 117, 119, 120
byte 122, 124, 125, 127, 129, 130, 132, 134
byte 136, 137, 139, 141, 143, 145, 146, 148
byte 150, 152, 154, 156, 158, 160, 162, 164
byte 166, 168, 170, 172, 174, 176, 178, 180
byte 182, 184, 186, 188, 191, 193, 195, 197
byte 199, 202, 204, 206, 209, 211, 213, 215
byte 218, 220, 223, 225, 227, 230, 232, 235
byte 237, 240, 242, 245, 247, 250, 252, 255
con
{{
Terms of Use: MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be included in all copies
or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
}}