MikroC

Thread Starter

ching fong kee

Joined Jun 23, 2010
42
if(sl<0){
Sound_Play(500, 250);
Sound_Play(1000, 250);
sl=0;

what is the 500 and 1000 stand for?
and that 250 is in period?
can someone help me to explain about this?
 

ELECTRONERD

Joined May 26, 2009
1,147
It's hard to say without more code. I have been working on something like this and use the following format:

Rich (BB code):
playNote(note, timer);
Thus, it will give me the note I want, that I previously stored in an array, and then the duration for how long I wish to play it.
 

DumboFixer

Joined Feb 10, 2009
217
if(sl<0){
Sound_Play(500, 250);
Sound_Play(1000, 250);
sl=0;

what is the 500 and 1000 stand for?
and that 250 is in period?
can someone help me to explain about this?
If you read the help information you should find they say

Generates the square wave signal on the appropriate pin.
Parameters :

  • freq_in_Hz: signal frequency in Hertz (Hz)
  • duration_ms: signal duration in miliseconds (ms)
so

Sound_Play(500, 250);
Sound_Play(1000, 250);

will play a tone of 500hz for 250ms followed by a tone of 1Khz for 250ms.

You'll need to initialise the library first with Sound_Init and have an appropriate output device on the desginated pin.
 
Top