- fix order for ws28xx

This commit is contained in:
Andrey Viktorov
2021-03-24 08:09:09 +03:00
parent 9e73191a91
commit 124ef36564
5 changed files with 30 additions and 19 deletions

View File

@@ -1,5 +1,15 @@
from itertools import permutations
order ='brg'
rgb = 'rgb'
RGB_COMBINATIONS = [''.join(x) for x in permutations('rgb')]
map_to_order = [rgb.index(x) for x in order]
map_from_order = [order.index(x) for x in rgb]
print(RGB_COMBINATIONS)
_rgb = [
rgb[x] for x in map_to_order
]
_order = [
_rgb[x] for x in map_from_order
]
print(_rgb, _order)