Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

41 lines
1.1KB

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