spacemanspiff2007 / PyArtNet

"Python wrappers for the Art-Net protocol to send DMX over Ethernet"
GNU General Public License v3.0
67 stars 13 forks source link

How to use 'set_values' ? #41

Closed wxlccsu1 closed 1 year ago

wxlccsu1 commented 1 year ago

Hi, i want set values for channels without fade, but it doesn't work。 fade mode works。

import asyncio
from pyartnet import ArtNetNode

async def main():
    # Run this code in your async function
    node = ArtNetNode('192.168.1.9', 6454)

    # Create universe 0
    universe = node.add_universe(8)
    channel = universe.add_channel(start=10, width=6)
    # channel.add_fade([255,0,0,0,255,0], 5000)
    channel.set_values([255,255,255,255,255,255])

    await channel
    # node.start_refresh()
    print('uuuuuu')
    # time.sleep(8)
    # print('uuuuuu--->')

asyncio.run(main())
spacemanspiff2007 commented 1 year ago

You have to use asyncio.sleep instead of time.sleep with e.g. 0.1 at the end.