Commit 634501a7 authored by Christian Wander's avatar Christian Wander
Browse files

adding hardcoded heart

parent fb4c7dd1
import sacn
import time
import json
count = 144
p = (255, 0, 255)
lightblue = (0, 255, 255)
blue = (0, 0, 255)
b = (0, 0, 0)
def main():
print(">> Hello, doing fancy python stuff.")
print(">> Hello, doing fancy pi stuff.")
universe = 1;
......@@ -16,25 +21,74 @@ def main():
sender[universe].destination = "192.168.178.37"
pink = (255, 0, 255)
lightblue = (0, 255, 255)
blue = (0, 0, 255)
# mode 4 Multiple RGB ('led0 red', 'led0 green', 'led0 blue', 'led1 red', ...)
# sender[universe].dmx_data = (255, 0, 255, 0, 255, 255, 0, 0, 255) ## some test DMX data
# sender[universe].dmx_data = pink + lightblue + blue
sender[universe].dmx_data = gimme(blue)
# sender[universe].dmx_data = gimme(pink)
# pink = (128, 128, 0, 128)
# sender[universe].dmx_data = (128, 128, 128, 0)
# sender[universe].dmx_data = (200, 0, 200)
sender[universe].dmx_data = heart()
# sender[universe].dmx_data = (5, 6, 7, 8)
## combining two tuples into one: (2, 4) + (5, 4) --> (2, 4, 5)
time.sleep(10)
## stopping the sender?!
sender.stop()
def heart():
return b + p + p + p + p + b + b + p + p + p + p + b + \
p + p + p + p + p + p + p + p + p + p + p + p + \
p + p + p + p + p + p + p + p + p + p + p + p + \
p + p + p + p + p + p + p + p + p + p + p + p + \
p + p + p + p + p + p + p + p + p + p + p + p + \
p + p + p + p + p + p + p + p + p + p + p + p + \
b + p + p + p + p + p + p + p + p + p + p + b + \
b + p + p + p + p + p + p + p + p + p + p + b + \
b + b + p + p + p + p + p + p + p + p + b + b + \
b + b + b + p + p + p + p + p + p + b + b + b + \
b + b + b + b + p + p + p + p + b + b + b + b + \
b + b + b + b + b + p + p + b + b + b + b + b
# def foo():
# # print("foo")
#
# colors = get_color_pixels('heart-12x12.pixil')
# tupels = hexlist_to_tuples(colors)
#
# print(tupels)
# def hexlist_to_tuples(hexlist):
# result = ()
#
# for c in hexlist:
# ct = to_color_tuple(c)
# # print(f'>> color: {ct}')
# result = result + ct
#
# return result
#
#
# def get_color_pixels(file):
#
# colors = None
#
# with open(file) as json_file:
# data = json.load(json_file)
# colors = data['colors']['default colors']
#
# return colors
#
# def to_color_tuple(color):
#
# # tuple(int(s[i:i+2], 16) for i in (0, 2, 4))
# return tuple(int(color[i:i+2], 16) for i in (0, 2, 4))
def gimme(color):
result = [0] * count * 3
......@@ -49,6 +103,6 @@ def gimme(color):
return result;
if __name__ == "__main__":
main()
\ No newline at end of file
main()
# foo()
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment