'Wiring:
' IRSend ---- Arduino Wirecolor
' GND ------- GND black
' Signal ---- PWM 12 yellow for Arduino
' Signal ---- Pin D3 yellow for NodeMCU ESP12
Sub Process_Globals
Public Serial1 As Serial
Private pf As PowerFunctions
Private Timer1 As Timer
Private Cnt As UInt = 0
Private start As Boolean = False
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
'Test MEGA
pf.Initialize(12, pf.CHANNEL4)
'Test NodeMCU
'pf.Initialize(0, pf.CHANNEL4)
Timer1.Initialize("Timer1_Tick", 1000)
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick
Log("Timer Tick: ", Cnt)
start = Not(start)
If start Then
pf.singlePWM(pf.BLUE, pf.PWM_FWD2)
Else
pf.singlePWM(pf.BLUE, pf.PWM_BRK)
End If
Cnt = Cnt + 1
If Cnt = 3 Then
pf.singlePWM(pf.BLUE, pf.PWM_BRK)
Timer1.Enabled = False
End If
End Sub