Hello All,
I have the sketch which blinks one LED every 1 sec [Connect at Pin10 with arduino].
Now I want to blink another LED at pin11. But it is not working.
The below is the sketch..
Please advice ..
Thanks-
Pokhraj Das
I have the sketch which blinks one LED every 1 sec [Connect at Pin10 with arduino].
Now I want to blink another LED at pin11. But it is not working.
The below is the sketch..
B4X:
#Region Project Attributes
#AutoFlushLogs: True
#CheckArrayBounds: True
#StackBufferSize: 300
#End Region
Sub Process_Globals
Public Serial1 As Serial
Private pin10 As Pin
Private pin11 As Pin
Private timer1 As Timer
Private timer2 As Timer
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
pin10.Initialize(10,pin10.MODE_OUTPUT)
pin11.Initialize(11,pin11.MODE_OUTPUT)
timer1.Initialize("blink_tick",1000)
timer2.Initialize("blink_tick2",2000)
timer1.Enabled=True
timer2.Enabled=True
End Sub
Private Sub blink_tick
Dim currentstate As Boolean
currentstate = pin10.DigitalRead
'Log("The value of current State : ", currentstate)
Dim newstate As Boolean= Not(currentstate)
'Log("The value of Newstate :" , newstate)
pin10.DigitalWrite(newstate)
'Log("The DR value : " , pin10.DigitalRead)
End Sub
Private Sub blink_tick2
Dim currentstate1 As Boolean
currentstate1 = pin11.DigitalRead
'Log("The value of current State1 : ", currentstate1)
Dim newstate1 As Boolean= Not(currentstate1)
'Log("The value of Newstate :" , newstate1)
pin11.DigitalWrite(newstate1)
'Log("The DR value : " , pin11.DigitalRead)
End Sub
Please advice ..
Thanks-
Pokhraj Das