66
"C" Programming Guide For Optimus S/R
3.4 Buzzer
This section describes the beeper manipulation routines.
The activation of the beeper is conducted by specifying a beeper sequence, which comprises
a number of beep frequency and beep duration pairs. Once a beeper sequence is specified,
the activation of the beeper is automatically handled by the background operating system.
There is no need for the application program to wait for the beeper to stop.
In addition, there are routines for determining whether a beeper sequence is undergoing, or
a beeper sequence is to be terminated immediately.
3.4.1 Beeper Sequence
A beeper sequence is an integer array that is used to instruct how the beeper is activated. It
comprises a number of pairs of beep frequency and duration. Each pair is one beep. When
the value of the beep duration is set to 0, it means the end of a beeper sequence, i.e. the
beeper will then terminate activation.
3.4.2 Beep Frequency
A beep frequency is an integer that is used to specify the frequency (tone) of the beeper
when it is activated. However, the value specified to the beep frequency is not the actual
frequency that the beeper generates. It is calculated by the following formula:
Beep Frequency = 76000 / Actual Frequency Desired
For example, if a frequency of 4 KHz is desired, the value of beep frequency should be 19.
If no sound is desired (pause), the beep frequency should be set to 0. Note that a beep with
frequency 0 does not terminate the beeper sequence. Suitable frequency range is from 1
KHz to 6 KHz, whereas the peak is at 4 KHz.
Содержание Optimus R
Страница 1: ...Printed on 20 March 2006 C Programming Guide Version 3 04 02 Optimus S Optimus R...
Страница 6: ......
Страница 8: ...2 C Programming Guide For Optimus S R...
Страница 12: ...6 C Programming Guide For Optimus S R The flow is illustrated as shown below...
Страница 23: ...Chapter 2 Development Environment 17 Different types signed unsigned Different types same size...
Страница 24: ...18 C Programming Guide For Optimus S R...
Страница 220: ...214 C Programming Guide For Optimus S R See Also FlashSize free_memory...
Страница 232: ...226 C Programming Guide For Optimus S R 4 11 Implementation defined Limits limits h float h Refer to limit h and float h...
Страница 238: ...232 C Programming Guide For Optimus S R...