388
Platforms
©2000-2008 Tibbo Technology Inc.
pattern play at "normal" or double speed.
You load the new pattern to play with the
method. If the pattern is
looped it will continue playing until you changed it. If the pattern is not looped it
will play once and then the
event will be generated.
Buzzer patters offer a convenient way to tell the user what your system is doing.
You can devise different patterns for different states of your device. You can use
these patterns together with LED patterns generated by the
object.
Here is a simple example in which we generate three beeps on power up of the
device.
sub
on_sys_init
beep.play(
"B-B-B"
,PL_PAT_CANINT)
end
sub
To obtain a permanent, non-stop square wave on CO pin load the following
pattern:
beep.play(
"B~"
,PL_PAT_CANINT)
8.3.10.1
.Divider Property
Function:
Sets the frequency of the square wave output on the CO
line.
Type:
Word
Value Range:
0-65535, default= 1 (divide by 2)
See Also:
---
Details
Actual frequency can be calculated as base_frq/(2*beep.divider). Setting this
property to 0 is equivalent to 65536 (i.e. actual frequency will be
base_frq/131072).
Base_frq depends on your platform -- you will find this information in the
"Platform-dependent Programming Information" topic inside your platform
specifications section.
Most low-cost buzzers have resonant frequency at which they emit the loudest
sound. Check the specifications for your buzzer and set the divider accordingly.
8.3.10.2
On_beep Event
Function:
Generated when buzzer pattern finishes "playing".
Declaration:
on_beep
See Also:
,
389
388
384
387
389