Outputswitch(1,[temperature, C)]>30) outputfreq(1,[temperature, C)]*10) – PASCO Xplorer-GLX Users’ Guide User Manual

Page 58

Advertising
background image

52 C a l c u l a t o r

outputfreq(Channel, frequency)

Use the outputfreq function to set the fre-

quency of the audio output signal.

18

The first argument, Channel, can equal 1 (for

left) or 2 (for right) and identifies which channel is to be controlled. The second
argument, frequency, sets the frequency, in Hz, of the output signal. The fre-
quency can be set between 250 and 5000 Hz for the built-in speaker, or between
60 and 5000 Hz for headphones or external speakers.

outputvolume(volume)

Use this function to set the loudness of the output sig-

nals.

18

The argument of the function can be set between 0 (for no output) and 10

(for the loudest possible output). The function controls both audio channels
together.

Logic Operators and Functions

A logic function has two possible values: 0 and 1. A logic operator (

< or >) is

used to build an expression that can have a value of 0 or 1.

Less Than and Greater Than

If an expression such as a

< b is true, then it

equals 1. If the expression is false, then it equals 0.

inrange(min, max, x)

This function has three arguments: the first two, min

and max, define the upper and lower limit of a range, and the third, x, is an input
value to be compared with that range. If min

x max, then the function equals

1. If x

< min, or x > max, then the function equals 0.

and(a, b)

This function equals 0 if either of the arguments equals 0; otherwise

the function equals 1.

or(a, b)

This function equals 0 if both of the arguments equal 0; otherwise the

function equals 1.

not(x)

This function equals 1 if the argument equals 0; otherwise the function

equals 1.

Audio Temperature Indicator

In this example, the GLX is programed to emit a sound when the temperature
exceeds 30 °C. The frequency of the sound increases as the temperature
increases.

Connect a temperature sensor to the GLX. In the Calculator, enter these two
expressions:

outputswitch(1,[Temperature (

°

C)]>30)

outputfreq(1,[Temperature (

°

C)]*10)

Select the outputswitch and outputfreq functions from the

Functions menu.

Select the [Temperature (°C)] measurement from the

[Data] menu.

Press

to start data collection. Place the temperature sensor in warm water.

Then allow it to cool again. When the temperature reaches 30 °C, the GLX emits
a tone at 300 Hz. As the temperature rises, the frequency of the tone rises.

Audio Temperature Indicator Example

F1

F2

Advertising