Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

PassThroughQuad.ino 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * A simple hardware test which receives audio from the audio shield
  3. * Line-In pins and send it to the Line-Out pins and headphone jack.
  4. *
  5. * Four audio channels are used.
  6. *
  7. * This example code is in the public domain.
  8. */
  9. #include <Audio.h>
  10. #include <Wire.h>
  11. #include <SPI.h>
  12. #include <SD.h>
  13. #include <SerialFlash.h>
  14. // GUItool: begin automatically generated code
  15. AudioInputI2SQuad i2s_quad1; //xy=150,69
  16. AudioOutputI2SQuad i2s_quad2; //xy=365,94
  17. AudioConnection patchCord1(i2s_quad1, 0, i2s_quad2, 2);
  18. AudioConnection patchCord2(i2s_quad1, 1, i2s_quad2, 3);
  19. AudioConnection patchCord3(i2s_quad1, 2, i2s_quad2, 0);
  20. AudioConnection patchCord4(i2s_quad1, 3, i2s_quad2, 1);
  21. AudioControlSGTL5000 sgtl5000_1; //xy=302,184
  22. AudioControlSGTL5000 sgtl5000_2; //xy=302,254
  23. // GUItool: end automatically generated code
  24. const int myInput = AUDIO_INPUT_LINEIN;
  25. //const int myInput = AUDIO_INPUT_MIC;
  26. void setup() {
  27. // Audio connections require memory to work. For more
  28. // detailed information, see the MemoryAndCpuUsage example
  29. AudioMemory(12);
  30. // Enable the first audio shield, select input, and enable output
  31. sgtl5000_1.setAddress(LOW);
  32. sgtl5000_1.enable();
  33. sgtl5000_1.inputSelect(myInput);
  34. sgtl5000_1.volume(0.5);
  35. // Enable the second audio shield, select input, and enable output
  36. sgtl5000_2.setAddress(HIGH);
  37. sgtl5000_2.enable();
  38. sgtl5000_2.inputSelect(myInput);
  39. sgtl5000_2.volume(0.5);
  40. }
  41. void loop() {
  42. }