Hi,
I am new to this tool, I don't want to use sweeper to produce the hear rate data. I want to use my heart rate sequence, so I comment out the sweepBpm code. However, the update method seems never call.
By the way, how can we print string to the Output area.
My code is list as below, any suggestion will be appreciate.
Best regards,
tony
# This scripts sets up a heart rate sensor to transmit the specified
# range of sweeping values. Refer to the sesnsorSimulation module for additional
# details on the sweeping mechanism
from sensorSimulation import sweeper
from System.Timers import Timer
eventTimer = Timer(1000) # convert time to milliseconds
sweepBpm = sweeper()
# SWEEP CONFIGURATION - Modify the values in the following four lines to change the sweep characteristics
# Make sure that all of these are doubles (use a decimal point!) so that calculations are accurate
#sweepBpm.minValue = 71.0 # Minimum value in sweeping range, in bpm
#sweepBpm.maxValue = 71.0 # Maximum value in sweeping range in bpm
#sweepBpm.sweepTime = 1.0 # Time to sweep between the minimum and maximum values, in seconds
#sweepBpm.constantTime = 5.0 # Time to spend at a constant speed in the minimum and maximum values, in seconds
#simulator.HeartRate = sweepBpm.minValue
hr = [71.0,72.0,74.0,71.0]
icount = 0
simulator.HeartRate = hr[icount]
def update(sender, args):
icount=icount+1
simulator.HeartRate = hr[icount%4]
def stopScript():
#sweepBpm.stop()
eventTimer.Stop()
simulator.TurnOff()
eventTimer.Elapsed += update
simulator.TurnOn()
eventTimer.Start()
#sweepBpm.start()