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
Private S1,LecturaADC As Pin
Private valorTension As UInt
Private timerUno As Timer
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Delay(500)
Log("AppStart")
S1.Initialize(16, S1.MODE_OUTPUT)
S1.DigitalWrite(True)
valorTension = LecturaADC.AnalogRead
S1.DigitalWrite(False)
Log("valor Uno: ",valorTension)
valorTension = 0
S1.DigitalWrite(True)
CallSubPlus("lectura",0,0)
S1.DigitalWrite(False)
Log("valor Dos: ",valorTension)
timerUno.Initialize("timerTick",500)
timerUno.Enabled = True
End Sub
Public Sub timerTick
End Sub
Public Sub lectura (tag As Byte)
valorTension = LecturaADC.AnalogRead
End Sub