Application Guide

169 Program Editor Overview
Use of variable names without corresponding probes being physically attached will
result in a "Variable not defined" error.
The RefreshProbeVars command will be a NOP (null command) on iOS.
Collecting Sensor Data using RefreshProbeVars
1. Launch the Vernier DataQuest™ application.
2. Connect the sensor(s) you need to collect the data.
3. Run the program you wish to use to collect data in the calculator application.
4. Manipulate the sensors and collect the data.
Note: You may create a program to interact with the TI-Innovator Hub using b> Hub
> Send. (See Example 2, below.) This is optional.
Example 1
Define temp()=
Prgm
© Check if system is ready
RefreshProbeVars status
If status=0 Then
Disp "ready"
For n,1,50
RefreshProbeVars status
temperature:=meter.temperature
Disp "Temperature: ",temperature
If temperature>30 Then
Disp "Too hot"
EndIf
© Wait for 1 second between samples
Wait 1
EndFor
Else
Disp "Not ready. Try again later"
EndIf
EndPrgm
Example 2- with TI-Innovator™ Hub
Define tempwithhub()=
Prgm
© Check if system is ready
RefreshProbeVars status
If status=0 Then
Disp "ready"
For n,1,50
RefreshProbeVars status
temperature:=meter.temperature
Disp "Temperature: ",temperature
If temperature>30 Then
Disp "Too hot"
© Play a tone on the Hub
Send "SET SOUND 440 TIME 2"
EndIf