简体   繁体   English

DMX Arduino-关闭Martin Exterior 600灯具上的灯

[英]DMX Arduino - Turn OFF lamp on Martin Exterior 600 fixture

I have made a web based light controller, and everything is working perfectly. 我已经制作了一个基于Web的灯光控制器,并且一切运行正常。 But i have a problem turning off one of the fixtures. 但是我在关闭其中一个灯具时遇到了问题。

For turning OFF the lamp, a value of 250 has to be send on channel 17 for at least 5 sec. 为了关闭灯泡,必须在通道17上发送250的值至少5秒钟。 And this is where it gets tricky, how do I do that? 这就是棘手的地方,我该怎么做?

I am using the DMXSerial library from http://www.mathertel.de/Arduino/DMXSerial.aspx , but it lacks documentation. 我正在使用http://www.mathertel.de/Arduino/DMXSerial.aspx的DMXSerial库,但缺少文档。

Here is a small piece off the code. 这是代码的一小部分。

if(finder.find("#dmx")) { // Find out if this is a dmx string.
  if(finder.findUntil("type", ",")) {   // Finds the type
     cmd = finder.getValue();       // Putting the value found in its variable.
        if(cmd == 4) {
          if(finder.findUntil("ch", ",")) {
          channel = finder.getValue();
          }
          if(finder.findUntil("va", ",\n\r")) {
          val = finder.getValue();
          }
          if(channel == 17 && val == 250) {

            // some code here

          } else {
            DMXSerial.write(channel, val);
          }
        }
      }

Any help will be welcome. 任何帮助都将受到欢迎。

The DMXSerial library's initialization DMXSerial库的初始化

DMXSerial.init(DMXController);

enables the transmitter to be sending in the background and repeat sending the default values for the 512 channels, stored. 使发射机能够在后台发送并重复发送存储的512通道的默认值。 Where 哪里

DMXSerial.write(ch, value);

updates the specified buffer location, which in turn is being sent out in the background. 更新指定的缓冲区位置,该位置又在后台发送。

The DMX frame is simply being repeated in the background, by way of transmit complete interrupts. 通过发送完整的中断,仅在后台重复DMX帧。 A whole frame of 512 channels approximately repeats at 44Hz rate. 512通道的整个帧大约以44Hz的频率重复。

Since it is interrupt driven there is nothing more you need to do. 由于它是由中断驱动的,因此您无需执行其他操作。 So in essence it should be simply: 因此,从本质上讲,它应该很简单:

...
DMXSerial.write(17, 250);
delay(5100); 
DMXSerial.write(17, 0); // or something else
...

I would think a web put of updating the appropriate channel with a value that was 250 would suffice. 我认为用250来更新适当频道的网络投放就足够了。 As long as it was not updated again with something other than 250. As the background will keep sending it, until updated with something different. 只要不再使用250以外的其他东西进行更新即可。因为背景将一直发送,直到使用其他内容进行更新为止。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM