AD9833-Library-Arduino icon indicating copy to clipboard operation
AD9833-Library-Arduino copied to clipboard

Tried to make a beeping sound

Open Blaubart opened this issue 4 years ago • 8 comments

Hi,

I tried to make a beeping sound so I used gen.SleepMode(true); and gen.SleepMode(false); to start and stop the sound. But I get a clicking noise. Is there a better way to realise beeping?

Blaubart avatar May 29 '20 10:05 Blaubart

I am having a similar issue, were you able to solve it? https://forum.arduino.cc/t/popping-sound-when-disabling-output-from-sine-tone-generator-ad9833/1099574

ma7555 avatar Mar 09 '23 08:03 ma7555

I solved it by using while loop and two commands: gen.IncrementFrequency (REG0, freq); gen.ApplySignal(SINE_WAVE, REG0, 0);

gen.IncrementFrequency is able to increase or decrease frequency gradually to the value you like to have. If the sound should stop I use gen.ApplySignal(SINE_WAVE, REG0, 0);

Blaubart avatar Mar 09 '23 16:03 Blaubart

I tried gen.ApplySignal(SINE_WAVE, REG0, 0); but the clicking is the same as with gen.EnableOutput(false); Do you keep decreasing frequency till 0?

ma7555 avatar Mar 14 '23 16:03 ma7555

Yes I decreased till 0

Am 14.03.2023 um 17:39 schrieb ma7555 @.*** @.***>>:

I tried gen.ApplySignal(SINE_WAVE, REG0, 0); but the clicking is the same as with gen.EnableOutput(false); Do you keep decreasing frequency till 0?

— Reply to this email directly, view it on GitHub https://github.com/Billwilliams1952/AD9833-Library-Arduino/issues/9#issuecomment-1468448120, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBDZEUNTNGHUOWEHLRNSTW4CNN5ANCNFSM4NN57GRQ. You are receiving this because you authored the thread.

Blaubart avatar Mar 14 '23 16:03 Blaubart

I start at freq 5000 and then did this

    for (int i = 0; i < 5; i++) {
        gen.IncrementFrequency(REG0, -1000);
    }
    gen.ApplySignal(SINE_WAVE, REG0, 0);

But the click is still there. Can you post your code?

ma7555 avatar Mar 14 '23 20:03 ma7555

    freqValueNeg = (-1 * freqValueOld) / 8;
    int  i = 0;
    while (i < 8 && freqValueNeg < 0) {
      i = i + 1;
      gen.IncrementFrequency (REG0, freqValueNeg);
      delay(1);
    }
    gen.ApplySignal(SINE_WAVE, REG0, 0);
    freqValueOld = 0;

Am 14.03.2023 um 21:22 schrieb ma7555 @.***>:

I start at freq 5000 and then did this

for (int i = 0; i < 5; i++) {
    gen.IncrementFrequency(REG0, -1000);
}
gen.ApplySignal(SINE_WAVE, REG0, 0);

But the click is still there. Can you post your code?

— Reply to this email directly, view it on GitHub https://github.com/Billwilliams1952/AD9833-Library-Arduino/issues/9#issuecomment-1468783801, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBDZCPYY6PKAJXABSG5ULW4DHQLANCNFSM4NN57GRQ. You are receiving this because you authored the thread.

Blaubart avatar Mar 14 '23 21:03 Blaubart

I still find the cleanest turn off is using

      gen.EnableOutput(true);
      delay(1000);
      gen.EnableOutput(false);

Thanks bro for your help

ma7555 avatar Mar 21 '23 21:03 ma7555

pefect! Sorry, that I couldn’t really help!!

Am 21.03.2023 um 22:04 schrieb ma7555 @.***>:

I still find the cleanest turn off is using

  gen.EnableOutput(true);
  delay(1000);
  gen.EnableOutput(false);

Thanks bro for your help

— Reply to this email directly, view it on GitHub https://github.com/Billwilliams1952/AD9833-Library-Arduino/issues/9#issuecomment-1478577751, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBDZBOK54H5S277CXUMD3W5IJXVANCNFSM4NN57GRQ. You are receiving this because you authored the thread.

Blaubart avatar Mar 22 '23 17:03 Blaubart