MikroC

Discussion in 'Programmer's Corner' started by ching fong kee, Jul 31, 2010.

  1. ching fong kee

    Thread Starter Member

    Jun 23, 2010
    42
    0
    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?
     
  2. ELECTRONERD

    Senior Member

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

    Code ( (Unknown Language)):
    1. 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.
     
  3. CVMichael

    Senior Member

    Aug 3, 2007
    416
    17
  4. ching fong kee

    Thread Starter Member

    Jun 23, 2010
    42
    0
    playNote(note, timer);
    is it this need to declare before?
    how to declare it?
     
  5. tom66

    Senior Member

    May 9, 2009
    2,613
    213
    No, you need to look up the definition in the documentation, to find out how you should use the function.
     
  6. ELECTRONERD

    Senior Member

    May 26, 2009
    1,146
    16
    Yes, I created a function or "driver" which will initiate whenever I put in that segment of code I showed you before. It's almost similar to a subroutine.
     
  7. DumboFixer

    Active Member

    Feb 10, 2009
    219
    34
    If you read the help information you should find they say

    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.
     
Loading...