
PyArtNet: 是一个用于 Art-Net 协议的 Python 包装器,并可在以太网上发送 DMX 信号。
5星
- 浏览量: 0
- 大小:None
- 文件类型:ZIP
简介:
Python实现了ArtNet协议的技术框架,该技术框架提供了一种简洁且高效的编程方式来操作基于这个协议的网络设备。以下是如何使用该库实现淡入淡出功能的具体步骤:
通过以下语句导入该类:
from pyartnet import ArtNetNode
node = ArtNetNode ( IP )
await node . start ()
为新的DMX通道初始化了一个数据流。
# Create universe 0
universe = node . add_universe ( 0 )
# Add a channel to the universe which consists of 3 values
# Default size of a value is 8Bit (0..255) so this would fill
# the DMX values 1..3 of the universe
channel = universe . add_channel(
start=1,
width=3,
dataflow=(0b000, 0b001, 0b010),
)
node.start universes with default fade-in and fade-out settings.
# Start all created universes with default fade-in and fade-out settings.
for universe in node.universes:
universe.start()
# Add a channel to the first universe which consists of 3 values
# Default size of a value is 8Bit (0..255) so this would fill
# the DMX values 1..3 of the first universe
channel = node.add_channel(
start=1,
width=3,
dataflow=(0b000, 0b001, 0b010),
)
node.start() will automatically apply a fade-in and fade-out effect across all channels by default.
# Start the node to automatically apply a fade-in and fade-out effect across all channels
node.start()
# Once started, the universes will begin with full brightness and gradually transition to full darkness before restarting.
全部评论 (0)


