Hi,
I’m very new to Daisy, I have just received my Seed yesterday.
Basically, I’m trying to modify the oscillator frequency using a potentiometer. But the read of ADC always returns the same value whatever the pot position…
I have tested the Knob example from Web programmer, and it works.
If i comment the line seed.StartAudio(AudioCallback);
it works. (PS I have tested with empty AudioCallback
, same result, doesn’t work)
I’m using
- libDaisy@
c5c1026
like in DaisyExample repo - DaisySP@
5a6b618
like in DaisyExample repo - STM32 Cube IDE
Do you have experienced such issue ?
EDIT : I also have the issue if read the ADC in the AudioCallback
Here is my code :
int main(void)
{
// initialize seed hardware and oscillator daisysp module
float sample_rate;
seed.Configure();
seed.Init();
sample_rate = seed.AudioSampleRate();
// Oscillators init
for (int i = 0; i < OSC_COUNT; i++)
{
freqs[i] = BASE_FREQ + i*FREQ_INC_FACTOR;
oscs[i].Init(sample_rate);
oscs[i].SetWaveform(Oscillator::WAVE_RAMP);
oscs[i].SetFreq(freqs[i]);
oscs[i].SetAmp(0.5);
}
// ADC init
AdcChannelConfig adcConfig;
adcConfig.InitSingle(seed.GetPin(21));
seed.adc.Init(&adcConfig, 1);
seed.adc.Start();
// start callback
seed.StartAudio(AudioCallback);
volatile bool ledState = false;
while(1)
{
freqModifier = seed.adc.GetFloat(0);
seed.SetLed(ledState);
ledState = !ledState;
dsy_system_delay(100);
}
}