簡體   English   中英

DMX Arduino-關閉Martin Exterior 600燈具上的燈

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

我已經制作了一個基於Web的燈光控制器,並且一切運行正常。 但是我在關閉其中一個燈具時遇到了問題。

為了關閉燈泡,必須在通道17上發送250的值至少5秒鍾。 這就是棘手的地方,我該怎么做?

我正在使用http://www.mathertel.de/Arduino/DMXSerial.aspx的DMXSerial庫,但缺少文檔。

這是代碼的一小部分。

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);
          }
        }
      }

任何幫助都將受到歡迎。

DMXSerial庫的初始化

DMXSerial.init(DMXController);

使發射機能夠在后台發送並重復發送存儲的512通道的默認值。 哪里

DMXSerial.write(ch, value);

更新指定的緩沖區位置,該位置又在后台發送。

通過發送完整的中斷,僅在后台重復DMX幀。 512通道的整個幀大約以44Hz的頻率重復。

由於它是由中斷驅動的,因此您無需執行其他操作。 因此,從本質上講,它應該很簡單:

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

我認為用250來更新適當頻道的網絡投放就足夠了。 只要不再使用250以外的其他東西進行更新即可。因為背景將一直發送,直到使用其他內容進行更新為止。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM