Browse Source

Add PassThroughADCtoI2S example

dds
PaulStoffregen 4 years ago
parent
commit
66d89d911c
1 changed files with 39 additions and 0 deletions
  1. +39
    -0
      examples/HardwareTesting/PassThroughADCtoI2S/PassThroughADCtoI2S.ino

+ 39
- 0
examples/HardwareTesting/PassThroughADCtoI2S/PassThroughADCtoI2S.ino View File

@@ -0,0 +1,39 @@
/*
* A simple hardware test which receives audio on the A2 analog pin
* and sends it to the audio shield (I2S digital audio)
*
* This example code is in the public domain.
*/

#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

// GUItool: begin automatically generated code
AudioInputAnalog adc1; //xy=197,73
AudioOutputI2S i2s1; //xy=375,85
AudioConnection patchCord1(adc1, 0, i2s1, 0);
AudioConnection patchCord2(adc1, 0, i2s1, 1);
AudioControlSGTL5000 sgtl5000_1; //xy=314,158
// GUItool: end automatically generated code


void setup() {
// Audio connections require memory to work. For more
// detailed information, see the MemoryAndCpuUsage example
AudioMemory(12);

// Enable the audio shield
sgtl5000_1.enable();
sgtl5000_1.volume(0.5);
}

void loop() {
// Do nothing here. The Audio flows automatically

// When AudioInputAnalog is running, analogRead() must NOT be used.
}



Loading…
Cancel
Save