Datasheet

Programming PIC Microcontrollers in BASIC - mikroElektronika
5.2.21.2 Sound_Play – Plays sound at specified port
Prototype sub procedure Sound_Play(dim byref Port, dim Pin as byte)
Description Procedure Sound_Play plays the sound at the specified port pin. <Period_div_10> is a sound period given in
MCU cycles divided by ten, and generated sound lasts for a specified number of periods (<Num_of_Periods>).
For example, if you want to play sound of 1KHz: T = 1/f = 1ms = 1000 cycles @ 4MHz<.
code>. This gives us our first parameter: 1000/10 = 100. Then, we could
play 150 periods like this: Sound_Play(100, 150).
Example
...
Sound_Init(PORTB,2) ' Initialize sound on PORTB.RB2
while true
adcValue = ADC_Read(2) ' Get lower byte from ADC
Sound_Play(adcValue, 200) ' Play the sound
wend
5.2.22 Trigonometry Library
http://www.mikroelektronika.co.yu/english/product/books/picbasicbook/05.htm (109 sur 112)05/11/2004 02:20:55