您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

40 行
1017B

  1. /*
  2. * A simple hardware test which receives audio on the A2 analog pin
  3. * and sends it to the audio shield (I2S digital audio)
  4. *
  5. * This example code is in the public domain.
  6. */
  7. #include <Audio.h>
  8. #include <Wire.h>
  9. #include <SPI.h>
  10. #include <SD.h>
  11. #include <SerialFlash.h>
  12. // GUItool: begin automatically generated code
  13. AudioInputAnalog adc1; //xy=197,73
  14. AudioOutputI2S i2s1; //xy=375,85
  15. AudioConnection patchCord1(adc1, 0, i2s1, 0);
  16. AudioConnection patchCord2(adc1, 0, i2s1, 1);
  17. AudioControlSGTL5000 sgtl5000_1; //xy=314,158
  18. // GUItool: end automatically generated code
  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
  24. sgtl5000_1.enable();
  25. sgtl5000_1.volume(0.5);
  26. }
  27. void loop() {
  28. // Do nothing here. The Audio flows automatically
  29. // When AudioInputAnalog is running, analogRead() must NOT be used.
  30. }