Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

61 rinda
1.1KB

  1. #include <Audio.h>
  2. #include <Wire.h>
  3. #include <SD.h>
  4. AudioSynthWaveform mysine(AudioWaveformSine);
  5. AudioOutputI2Sslave dac;
  6. AudioControlWM8731master codec;
  7. AudioConnection c1(mysine,dac);
  8. int volume = 0;
  9. void setup() {
  10. codec.enable();
  11. delay(100);
  12. while (!Serial) ;
  13. Serial.println("Begin AudioTest");
  14. // Audio connections require memory to work. For more
  15. // detailed information, see the MemoryAndCpuUsage example
  16. AudioMemory(15);
  17. mysine.frequency(440);
  18. mysine.amplitude(0.9);
  19. codec.volume(70);
  20. Serial.println("setup done");
  21. }
  22. void loop() {
  23. /*
  24. Serial.print("cpu: ");
  25. Serial.print(AudioProcessorUsage());
  26. Serial.print(", max: ");
  27. Serial.print(AudioProcessorUsageMax());
  28. Serial.print(", memory: ");
  29. Serial.print(AudioMemoryUsage());
  30. Serial.print(", max: ");
  31. Serial.print(AudioMemoryUsageMax());
  32. Serial.println("");
  33. */
  34. //int n;
  35. //n = analogRead(15);
  36. //Serial.println(n);
  37. //if (n != volume) {
  38. //volume = n;
  39. //codec.volume((float)n / 10.23);
  40. //}
  41. //n = analogRead(16) / 8;
  42. //Serial.println(n);
  43. //mysine.frequency(200 + n * 4);
  44. //delay(5);
  45. }