Skip to content

add volume control in the 3_Second_order_EQ sample #46

@vinhx

Description

@vinhx

hi Hans,

thanks you alot with great library to let newbine at arduino guy like can play with adau1401
I try play with the 1_Volume1.ino and 3_Second_order_EQ.ino, it run well as my expected, then I would like to add the volume control feature into the and 3_Second_order_EQ.ino's loop() by add some snippet copy from the 1_Volume1.ino , I upload sketch successful ,but not thing change with the volume leave that I heard
3_Second_order_EQ.ino.txt

// Slowly adjust the volume down to -50dB
Serial.println(F("Fading down"));
for(int8_t i = 0; i > -51; i--)
{
dsp.volume_slew(MOD_SWVOL1_ALG0_TARGET_ADDR, i, 12); // (First volume slider address, dB value, optional slew value)
delay(200);
}

// Slowly adjust the volume up to 0dB
Serial.println(F("Fading up"));
for(int8_t i = -50; i < 1; i++)
{
dsp.volume_slew(MOD_SWVOL1_ALG0_TARGET_ADDR, i); // Slew rate is default 12
delay(200);
}

I try to find the different from header in both those example, so one confuse that I found here
from the 1_Volume1.ino

/* Module SW vol 1 - Single SW slew vol (adjustable)*/
#define MOD_SWVOL1_COUNT 2

#define MOD_SWVOL1_ALG0_TARGET_ADDR 0
#define MOD_SWVOL1_ALG0_TARGET_FIXPT 0x00800000

#define MOD_SWVOL1_ALG0_STEP_ADDR 1
#define MOD_SWVOL1_ALG0_STEP_FIXPT 0x00000800

from 3_Second_order_EQ.ino

/* Module SW vol 1 - Single SW slew vol (adjustable)*/
#define MOD_SWVOL1_COUNT 4

#define MOD_SWVOL1_ALG0_TARGET_ADDR 20
#define MOD_SWVOL1_ALG0_TARGET_FIXPT 0x00800000

#define MOD_SWVOL1_ALG0_STEP_ADDR 21
#define MOD_SWVOL1_ALG0_STEP_FIXPT 0x00000800

#define MOD_SWVOL1_ALG1_TARGET_ADDR 22
#define MOD_SWVOL1_ALG1_TARGET_FIXPT 0x00800000

#define MOD_SWVOL1_ALG1_STEP_ADDR 23
#define MOD_SWVOL1_ALG1_STEP_FIXPT 0x00000800

--- > Question is the the define on "#define MOD_SWVOL1_COUNT 4" and "#define MOD_SWVOL1_ALG0_TARGET_ADDR 20 " cause issue
thank you in advance!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions