Sub Process_Globals
Public Serial1 As Serial
Private Channel As Int 'ignore 1-10
Private Value As Byte 'ignore 0-255
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
RunNative ("initialize", Null)
Set_Channel_Value (2, 127)
Set_Channel_Value (4, 50)
End Sub
private Sub Set_Channel_Value(ch As Int, val As Byte)
Channel = ch
Value = val
RunNative("setchannelvalue", Null)
End Sub
#if C
#include <Conceptinetics.h>
#define DMX_MASTER_CHANNELS 10
#define RXEN_PIN 2
DMX_Master dmx_master ( DMX_MASTER_CHANNELS, RXEN_PIN );
void initialize (B4R::Object* o) {
dmx_master.enable ();
}
void setchannelvalue(B4R::Object* o) {
dmx_master.setChannelValue ( b4r_main::_channel, b4r_main::_value );
}
#End If