initial commit
This commit is contained in:
15
artnet.py
Normal file
15
artnet.py
Normal file
@@ -0,0 +1,15 @@
|
||||
def buildPacket(universe, dimmer, dmxdata):
|
||||
# Stolen from fire-ohmlogo.py by OHM2013
|
||||
size = len(dmxdata) * 3
|
||||
# 01234567 8 9 a b c d e f 10 11
|
||||
# op-code protver seq phy universe len
|
||||
data = bytearray("Art-Net\x00\x00\x50\x00\x0e\x00\x00",'ascii')
|
||||
data.append(int(universe % 256))
|
||||
data.append(int(universe / 256))
|
||||
data.append(int(size / 256))
|
||||
data.append(int(size % 256))
|
||||
for (r, g, b) in dmxdata:
|
||||
data.append(int(dimmer*r/255))
|
||||
data.append(int(dimmer*g/255))
|
||||
data.append(int(dimmer*b/255))
|
||||
return data
|
||||
Reference in New Issue
Block a user