#Region Project Attributes
#AutoFlushLogs: True
#CheckArrayBounds: True
#StackBufferSize: 300
#End Region
Sub Process_Globals
Public Serial1 As Serial
Private TlcChannel, TlcValue As Int
Private tmr As Timer
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
RunNative("TlcInit", Null)
RunNative("TlcClear", Null)
tmr.Initialize("tmr_Tick",2000)
tmr.Enabled = True
End Sub
Sub tmr_Tick
TlcSet(11,4000)
TlcSet(12,4000)
TlcSet(14,4000)
RunNative("TlcUpdate", Null)
Delay(1000)
TlcSet(11,0)
TlcSet(12,0)
TlcSet(14,0)
RunNative("TlcUpdate", Null)
End Sub
Private Sub TlcSet(Channel As Int, Value As Int)
TlcChannel = Channel
TlcValue = Value
RunNative("TlcSet", Null)
End Sub
#If C
#include <Tlc5940.h>
void TlcInit(B4R::Object* o) {
Tlc.init();
}
void TlcClear(B4R::Object* o) {
Tlc.clear();
}
void TlcSet(B4R::Object* o) {
Tlc.set(b4r_main::_tlcchannel, b4r_main::_tlcvalue);
}
void TlcUpdate(B4R::Object* o) {
Tlc.update();
}
#End If