Mikroelektronika MIKROE-742 데이터 시트

다운로드
페이지 532
SOUND LIBRARY
The mikroPascal PRO for AVR provides a Sound Library to supply users with routines necessary
for sound signalization in their applications. Sound generation needs additional hardware, such
as piezo-speaker (example of piezo-speaker interface is given on the schematic at the bottom of
this page).
External dependencies of Sound Library
Library Routines
- Sound_Init 
- Sound_Play 
Sound_Init
370
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroPASCAL PRO for AVR
CHAPTER 6
The following variables
must be defined in all
projects using Sound
Library:
Description: 
Example : 
var Sound_Play_Pin :
sbit; sfr; external;
Sound output pin.
var Sound_Play_Pin :
sbit at PORTC.B3;
var
Sound_Play_Pin_Direct
ion : 
sbit; sfr;
external;
Direction of the Sound out-
put pin.
var
Sound_Play_Pin_Direct
ion : 
sbit at
DDRC.B3;
Prototype
procedure Sound_Init();
Returns
Nothing.
Description
Configures the appropriate MCU pin for sound generation.
Requires
Global variables: 
Sound_Play_Pin
: Sound output pin 
Sound_Play_Pin_Direction
: Direction of the Sound output pin 
must be defined before using this function.
Example
// Sound library connections
var Sound_Play_Pin : sbit at PORTC.B3;         
var Sound_Play_Pin_Direction : sbit at DDRC.B3;
// End of Sound library connections
...
Sound_Init();