You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PassThroughAnalog.ino 1.1KB

10 vuotta sitten
1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include <Audio.h>
  2. #include <Wire.h>
  3. #include <SPI.h>
  4. #include <SD.h>
  5. // Create the Audio components. These should be created in the
  6. // order data flows, inputs/sources -> processing -> outputs
  7. //
  8. AudioInputAnalog analogPinInput(A2); // analog A2 (pin 16)
  9. AudioOutputI2S audioOutput; // audio shield: headphones & line-out
  10. AudioOutputPWM pwmOutput; // audio output with PWM on pins 3 & 4
  11. // Create Audio connections between the components
  12. //
  13. AudioConnection c1(analogPinInput, 0, audioOutput, 0);
  14. AudioConnection c2(analogPinInput, 0, audioOutput, 1);
  15. AudioConnection c3(analogPinInput, 0, pwmOutput, 0);
  16. // Create an object to control the audio shield.
  17. //
  18. AudioControlSGTL5000 audioShield;
  19. void setup() {
  20. // Audio connections require memory to work. For more
  21. // detailed information, see the MemoryAndCpuUsage example
  22. AudioMemory(12);
  23. // Enable the audio shield and set the output volume.
  24. audioShield.enable();
  25. audioShield.volume(0.6);
  26. }
  27. void loop() {
  28. // Do nothing here. The Audio flows automatically
  29. // When AudioInputAnalog is running, analogRead() must NOT be used.
  30. }