Rolfdegen
Well-known member
Hallo friends
I'm starting with Teensy 4.0 and I have a little problem.
I want to control the frequency of a waveform with a potentiometer on analog input A0. The potentiometer is connected to the 3.3V supply voltage and GND. The internal reference voltage for the ADC is 3.3V
The problem: There is a jump at one point in the frequency sweep. The jump in the ADC value can also be seen on the serial plotter. I used a different analog input. It's the same problem. I also tested different ADC resolutions. Without success.
My hardware
ADC digital input values
Greetings Rolf
I'm starting with Teensy 4.0 and I have a little problem.
I want to control the frequency of a waveform with a potentiometer on analog input A0. The potentiometer is connected to the 3.3V supply voltage and GND. The internal reference voltage for the ADC is 3.3V
The problem: There is a jump at one point in the frequency sweep. The jump in the ADC value can also be seen on the serial plotter. I used a different analog input. It's the same problem. I also tested different ADC resolutions. Without success.
My hardware
ADC digital input values
PHP:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioSynthWaveform waveform1; //xy=1123,493
AudioOutputI2S i2s1; //xy=1304,494
AudioConnection patchCord1(waveform1, 0, i2s1, 0);
AudioConnection patchCord2(waveform1, 0, i2s1, 1);
AudioControlSGTL5000 sgtl5000_1; //xy=1252,563
// GUItool: end automatically generated code
void setup() {
Serial.begin(38400);
AudioMemory(20);
sgtl5000_1.enable();
sgtl5000_1.volume(0.65);
waveform1.begin(WAVEFORM_SINE);
waveform1.amplitude(0.5);
}
int val_1;
void loop() {
val_1 = analogRead(A0);
waveform1.frequency(val_1);
Serial.println(val_1);
delay(10);
}
Greetings Rolf