'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim Label1 As Label
Dim Pulse As Button
Dim Reset As Button
Dim Label1 As Label
Dim Addition As RadioButton
Dim Subtraction As RadioButton
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("testscreen")
End Sub
Sub Activity_Resume
Dim IOIO As IOIO
Dim PulseIn As PulseInput
PulseIn = IOIO.OpenPulseInput (31,PulseIn.IP_FLOATING,PulseIn.RATE_16MHZ,PulseIn.NEGATIVE , True)
Dim Add1 As DigitalInput
Add1 = IOIO.OpenDigitalInput (34, Add1.IP_PULL_UP)
Dim Subt1 As DigitalInput
Subt1 = IOIO.OpenDigitalInput (35, Add1.IP_PULL_UP)
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Pulse_Click
Dim P As Int
If Addition.Checked = True Then
P= Label1.Text+1
Label1.Text = NumberFormat (P, 1, 0)
End If
If Subtraction.Checked = True Then
P= Label1.Text-1
Label1.Text = NumberFormat (P, 1, 0)
End If
End Sub
Sub Reset_Click
Label1.Text = "0"
End Sub
Sub Exit_Click
Dim Result As Int
Result = Msgbox2 ("Are you sure?", "Exit", "Yes", "No", "", Null)
If Result = DialogResponse.Positive Then
ExitApplication
End If
End Sub