My first code desnt work;
each 5 sec, all pins changed with timer.
I cheked with voltmeter(DC)
I touched Wemos D4 and GND pins.
After I seen 3.3volt on voltmeter.
but never change with each evet of timer.
I cant work with hardware of WEMOS D2R2
Notes : i tried
pinLED1.Initialize("D1", pinLED1.MODE_OUTPUT)
and
pinLED1.Initialize(1, pinLED1.MODE_OUTPUT)
each 5 sec, all pins changed with timer.
I cheked with voltmeter(DC)
I touched Wemos D4 and GND pins.
After I seen 3.3volt on voltmeter.
but never change with each evet of timer.
I cant work with hardware of WEMOS D2R2
Notes : i tried
pinLED1.Initialize("D1", pinLED1.MODE_OUTPUT)
and
pinLED1.Initialize(1, pinLED1.MODE_OUTPUT)
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public Serial1 As Serial
Public pinLED1 As Pin
Public pinLED2 As Pin
Public pinLED3 As Pin
Public pinLED4 As Pin
Public pinLED5 As Pin
Public pinLED6 As Pin
Public LightOn As Boolean
Public timer1 As Timer
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
Log("ledsss")
pinLED1.Initialize("D1", pinLED1.MODE_OUTPUT)
pinLED2.Initialize("D2", pinLED2.MODE_OUTPUT)
pinLED1.Initialize("D3", pinLED1.MODE_OUTPUT)
pinLED4.Initialize("D4", pinLED4.MODE_OUTPUT)
pinLED5.Initialize("D5", pinLED5.MODE_OUTPUT)
pinLED6.Initialize("D6", pinLED6.MODE_OUTPUT)
LightOn=True
pinLED1.DigitalWrite(True)
pinLED2.DigitalWrite(True)
pinLED3.DigitalWrite(True)
pinLED4.DigitalWrite(True)
pinLED5.DigitalWrite(True)
pinLED6.DigitalWrite(True)
Log("starts")
timer1.Initialize("timer1_tick",5000)
timer1.Enabled=True
End Sub
Sub timer1_tick
If LightOn=True Then LightOn=False Else LightOn=True
pinLED1.DigitalWrite(LightOn)
pinLED2.DigitalWrite(LightOn)
pinLED3.DigitalWrite(LightOn)
pinLED4.DigitalWrite(LightOn)
pinLED5.DigitalWrite(LightOn)
pinLED6.DigitalWrite(LightOn)
Log("Led durum >>: ",LightOn)
End Sub