Guest User

Untitled

a guest
Nov 11th, 2020
67
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <Audio.h>
  2. #include <Wire.h>
  3. #include <SPI.h>
  4. #include <SD.h>
  5. #include <SerialFlash.h>
  6.  
  7. // GUItool: begin automatically generated code
  8. AudioSynthWaveformSine sine1; //xy=229,639
  9. AudioInputTDM tdm1; //xy=377,427
  10. AudioMixer4 mixer1; //xy=577,337
  11. AudioMixer4 mixer2; //xy=577,403
  12. AudioMixer4 mixer3; //xy=579,475
  13. AudioMixer4 mixer4; //xy=579,546
  14. AudioMixer4 mixer5; //xy=785,426
  15. AudioOutputTDM tdm2; //xy=838,741
  16. AudioOutputUSB usb1; //xy=938,441
  17. AudioConnection patchCord1(sine1, 0, tdm2, 0);
  18. AudioConnection patchCord2(sine1, 0, tdm2, 1);
  19. AudioConnection patchCord3(sine1, 0, tdm2, 2);
  20. AudioConnection patchCord4(sine1, 0, tdm2, 3);
  21. AudioConnection patchCord5(sine1, 0, tdm2, 4);
  22. AudioConnection patchCord6(sine1, 0, tdm2, 5);
  23. AudioConnection patchCord7(sine1, 0, tdm2, 6);
  24. AudioConnection patchCord8(sine1, 0, tdm2, 7);
  25. AudioConnection patchCord9(sine1, 0, tdm2, 8);
  26. AudioConnection patchCord10(sine1, 0, tdm2, 9);
  27. AudioConnection patchCord11(sine1, 0, tdm2, 10);
  28. AudioConnection patchCord12(sine1, 0, tdm2, 11);
  29. AudioConnection patchCord13(sine1, 0, tdm2, 12);
  30. AudioConnection patchCord14(sine1, 0, tdm2, 13);
  31. AudioConnection patchCord15(sine1, 0, tdm2, 14);
  32. AudioConnection patchCord16(sine1, 0, tdm2, 15);
  33. AudioConnection patchCord17(tdm1, 0, mixer1, 0);
  34. AudioConnection patchCord18(tdm1, 1, mixer1, 1);
  35. AudioConnection patchCord19(tdm1, 2, mixer1, 2);
  36. AudioConnection patchCord20(tdm1, 3, mixer1, 3);
  37. AudioConnection patchCord21(tdm1, 4, mixer2, 0);
  38. AudioConnection patchCord22(tdm1, 5, mixer2, 1);
  39. AudioConnection patchCord23(tdm1, 6, mixer2, 2);
  40. AudioConnection patchCord24(tdm1, 7, mixer2, 3);
  41. AudioConnection patchCord25(tdm1, 8, mixer3, 0);
  42. AudioConnection patchCord26(tdm1, 9, mixer3, 1);
  43. AudioConnection patchCord27(tdm1, 10, mixer3, 2);
  44. AudioConnection patchCord28(tdm1, 11, mixer3, 3);
  45. AudioConnection patchCord29(tdm1, 12, mixer4, 0);
  46. AudioConnection patchCord30(tdm1, 13, mixer4, 1);
  47. AudioConnection patchCord31(tdm1, 14, mixer4, 2);
  48. AudioConnection patchCord32(tdm1, 15, mixer4, 3);
  49. AudioConnection patchCord33(mixer1, 0, mixer5, 0);
  50. AudioConnection patchCord34(mixer2, 0, mixer5, 1);
  51. AudioConnection patchCord35(mixer3, 0, mixer5, 2);
  52. AudioConnection patchCord36(mixer4, 0, mixer5, 3);
  53. AudioConnection patchCord37(mixer5, 0, usb1, 0);
  54. AudioControlCS42448 cs42448_1; //xy=438,681
  55. // GUItool: end automatically generated code
  56.  
  57. bool onoff=false;
  58. int led = 13;
  59.  
  60. void setup() {
  61. Serial.begin(9600);
  62.  
  63. // put your setup code here, to run once:
  64. pinMode(led, OUTPUT);
  65. digitalWrite(led, HIGH);
  66. delay(1000);
  67. digitalWrite(led, LOW);
  68. delay(1000);
  69. digitalWrite(led, HIGH);
  70. delay(1000);
  71. digitalWrite(led, LOW);
  72. delay(1000);
  73. digitalWrite(led, HIGH);
  74. Serial.println("start");
  75.  
  76. AudioMemory(64);
  77. onoff= cs42448_1.enable();
  78. if(onoff)digitalWrite(led, LOW);
  79.  
  80.  
  81. cs42448_1.volume(1);
  82. cs42448_1.inputLevel(15.85);
  83. mixer1.gain(0, 1);
  84. mixer1.gain(1, 1);
  85. mixer1.gain(2, 1);
  86. mixer1.gain(3, 1);
  87.  
  88. mixer2.gain(0, 1);
  89. mixer2.gain(1, 1);
  90. mixer2.gain(2, 1);
  91. mixer2.gain(3, 1);
  92.  
  93. mixer3.gain(0, 1);
  94. mixer3.gain(1, 1);
  95. mixer3.gain(2, 1);
  96. mixer3.gain(3, 1);
  97.  
  98. mixer4.gain(0, 1);
  99. mixer4.gain(1, 1);
  100. mixer4.gain(2, 1);
  101. mixer4.gain(3, 1);
  102.  
  103. mixer5.gain(0, 1);
  104. mixer5.gain(1, 1);
  105. mixer5.gain(2, 1);
  106. mixer5.gain(3, 1);
  107. sine1.amplitude(1);
  108. sine1.frequency(500);
  109.  
  110. }
  111.  
  112. void loop() {
  113. // put your main code here, to run repeatedly:
  114.  
  115. }
RAW Paste Data