示例#1
0
def main_no_artsync(universe, ip='127.0.0.1'):
    target_ip = ip
    packet_size = 512
    port = 6454
    a = StupidArtnet(target_ip, port, universe, packet_size)
    a.flash_all()  # send single packet with all channels at 255
    file.write(StupidArtnet.print_object_and_packet(a))
    a.show()
def main_artsync(universe, ip='127.0.0.1', nb_packet=50, tmp=5):
    packet_size = 512
    port = 6454
    a = StupidArtnet(ip, port, universe, packet_size)
    a.flash_all()  # send single packet with all channels at 255
    file.write(StupidArtnet.print_object_and_packet(a))
    a.start_artSync(nb_packet)
    time.sleep(tmp)
    a.stop_artSync()
示例#3
0
def main_no_artsync(universe1, universe2, ip='127.0.0.1'):
    packet_size = 512
    port = 6454
    a1 = StupidArtnet(ip, port, universe1, packet_size)
    a2 = StupidArtnet(ip, port, universe2, packet_size)
    a1.flash_all()  # send single packet with all channels at 255
    a2.flash_all()
    file.write(StupidArtnet.print_object_and_packet(a1))
    file.write(StupidArtnet.print_object_and_packet(a2))
    a1.show()
    a2.show()
示例#4
0
def main_artsync(universe1, universe2, ip='127.0.0.1', tmp=5, nb_packet=50):
    packet_size = 512
    port = 6454
    a1 = StupidArtnet(ip, port, universe1, packet_size)
    a2 = StupidArtnet(ip, port, universe2, packet_size)
    a1.flash_all()  # send single packet with all channels at 255
    a2.flash_all()
    file.write(StupidArtnet.print_object_and_packet(a1))
    file.write(StupidArtnet.print_object_and_packet(a2))
    group = ArtNetGroup(a1, a2)
    group.start(True)
    time.sleep(tmp)
    group.stop()
示例#5
0
def main_artsync(universe1, universe2, ip='127.0.0.1', slp=5):
    packet_size = 512
    port = 6454
    sync = StupidArtSync(ip)
    a1 = StupidArtnet(ip, port, universe1, packet_size)
    a2 = StupidArtnet(ip, port, universe2, packet_size)
    a1.flash_all()  # send single packet with all channels at 255
    a2.flash_all()
    file.write(StupidArtnet.print_object_and_packet(a1))
    file.write(StupidArtnet.print_object_and_packet(a2))
    sync.send()
    a1.show()
    a2.show()
    time.sleep(5)
    sync.send()
示例#6
0
def main_artsync(universe1,
                 universe2,
                 ip1='127.0.0.1',
                 ip2='127.0.0.2',
                 slp=5):
    packet_size = 512
    port = 6454
    a1 = StupidArtnet(ip1, port, universe1, packet_size)
    a2 = StupidArtnet(ip2, port, universe2, packet_size)
    a1.flash_all()  # send single packet with all channels at 255
    a2.flash_all()
    file.write(StupidArtnet.print_object_and_packet(a1))
    file.write(StupidArtnet.print_object_and_packet(a2))
    group = ArtNetGroup(a1, a2)
    group.show(True)
def main_no_artsync(universe1,
                    universe2,
                    ip1='127.0.0.1',
                    ip2='127.0.0.2',
                    tmp=5):
    packet_size = 512
    port = 6454
    a1 = StupidArtnet(ip1, port, universe1, packet_size)
    a2 = StupidArtnet(ip2, port, universe2, packet_size)
    a1.flash_all()  # send single packet with all channels at 255
    a2.flash_all()
    file.write(StupidArtnet.print_object_and_packet(a1))
    file.write(StupidArtnet.print_object_and_packet(a1))
    a1.start()
    a2.start()
    time.sleep(tmp)
    a1.stop()
    a2.stop()
示例#8
0
# YOU CAN CREATE YOUR OWN BYTE ARRAY OF PACKET_SIZE
packet = bytearray(packet_size)  # create packet for Artnet
for i in range(packet_size):  # fill packet with sequential values
    packet[i] = (i % 256)

# ... AND SET IT TO STUPID ARTNET
a.set(packet)  # only on changes

# ALL PACKETS ARE SAVED IN THE CLASS, YOU CAN CHANGE SINGLE VALUES
a.set_single_value(1, 255)  # set channel 1 to 255

# ... AND SEND
a.show()  # send data

# OR USE STUPIDARTNET FUNCTIONS
a.flash_all()  # send single packet with all channels at 255

time.sleep(1)  # wait a bit, 1 sec

a.blackout()  # send single packet with all channels at 0
a.see_buffer()

# ALL THE ABOVE EXAMPLES SEND A SINGLE DATAPACKET
# STUPIDARTNET IS ALSO THREADABLE
# TO SEND PERSISTANT SIGNAL YOU CAN START THE THREAD
a.start()  # start continuos sendin

# AND MODIFY THE DATA AS YOU GO
for x in range(100):
    for i in range(packet_size):  # Fill buffer with random stuff
        packet[i] = random.randint(0, 255)
示例#9
0
from lib.ArtNetGroup import ArtNetGroup
import time

ledstrip_data = [[[(0, 0), (0, 81), (0, 162)]], [], [], [], [], []]

print(ledstrip_data[0][0][1][1] + 12)
port = 6454
ip = '192.168.0.50'
group = ArtNetGroup()
tab_parabole = []
for x in range(150):
    tab_parabole.append(int(-x * (x - 255) / 63.75))

for i in range(100):
    a = StupidArtnet(ip, port, i)
    a.flash_all()
    group.add(a)

group.start(False)
time.sleep(30)
flash = True
for d in range(5):

    for i in group.listArtNet:
        if flash:
            i.blackout()
        else:
            i.flash_all()
    flash = not flash
    time.sleep(2)
time.sleep(2)