it might be needed to disable the "MSB First" bit, too:
I2S0_TCR4 = I2S_TCR4_FRSZ(1) | I2S_TCR4_SYWD(15) /* | I2S_TCR4_MF */ | I2S_TCR4_FSE | I2S_TCR4_FSP | I2S_TCR4_FSD;
ah, yes, and my descrition is for AudioOutputPT8211, not AudioOutputI2S
next time, please use the code-tag for code - this makes it way more readable in this forum..
I2S0_TCR4 = I2S_TCR4_FRSZ(1) | I2S_TCR4_SYWD(15) /* | I2S_TCR4_MF */ | I2S_TCR4_FSE | I2S_TCR4_FSP | I2S_TCR4_FSD;
ah, yes, and my descrition is for AudioOutputPT8211, not AudioOutputI2S
next time, please use the code-tag for code - this makes it way more readable in this forum..
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioSynthWaveform waveform1; //xy=110,75
[B]AudioOutputPT8211[/B] audioOutput; //xy=303,78
AudioConnection patchCord1(waveform1, 0, audioOutput, 0);
AudioConnection patchCord2(waveform1, 0, audioOutput, 1);
// GUItool: end automatically generated code
void setup() {
AudioMemory(16);
waveform1.begin(WAVEFORM_TRIANGLE);
waveform1.amplitude(0.99);
}
void loop() {
float freq = map(analogRead(A0), 0, 4095, 0.1, 2000);
waveform1.frequency(freq);
}
Last edited: