Advertisement
pleasedontcode

Audio Control rev_14

Dec 8th, 2024
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /********* Pleasedontcode.com **********
  2.  
  3.     Pleasedontcode thanks you for automatic code generation! Enjoy your code!
  4.  
  5.     - Terms and Conditions:
  6.     You have a non-exclusive, revocable, worldwide, royalty-free license
  7.     for personal and commercial use. Attribution is optional; modifications
  8.     are allowed, but you're responsible for code maintenance. We're not
  9.     liable for any loss or damage. For full terms,
  10.     please visit pleasedontcode.com/termsandconditions.
  11.  
  12.     - Project: Audio Control
  13.     - Source Code compiled for: Arduino Uno
  14.     - Source Code created on: 2024-12-08 10:40:31
  15.  
  16. ********* Pleasedontcode.com **********/
  17.  
  18. /****** SYSTEM REQUIREMENTS *****/
  19. /****** SYSTEM REQUIREMENT 1 *****/
  20.     /* after power change gain to max volume of PT7314 */
  21. /****** END SYSTEM REQUIREMENTS *****/
  22.  
  23.  
  24. /* START CODE */
  25.  
  26. /****** DEFINITION OF LIBRARIES *****/
  27. #include <Wire.h>
  28. #include <PT2314.h> //https://github.com/RobTillaart/PT2314
  29.  
  30. /****** FUNCTION PROTOTYPES *****/
  31. void setup(void);
  32. void loop(void);
  33.  
  34. /***** DEFINITION OF I2C PINS *****/
  35. const uint8_t audio_PT7314_I2C_PIN_SDA_A4       = A4;
  36. const uint8_t audio_PT7314_I2C_PIN_SCL_A5       = A5;
  37. const uint8_t audio_PT7314_I2C_SLAVE_ADDRESS        = 68;
  38.  
  39. /****** DEFINITION OF LIBRARIES CLASS INSTANCES*****/
  40. PT7314 audioProcessor(&Wire); // Create an instance of the PT7314 class
  41.  
  42. void setup(void)
  43. {
  44.     // Initialize I2C communication
  45.     Wire.begin();
  46.  
  47.     // Begin the audio processor
  48.     if (audioProcessor.begin()) {
  49.         // Set gain to maximum volume
  50.         audioProcessor.setGain(0); // Assuming 0 is max gain for PT7314
  51.     }
  52. }
  53.  
  54. void loop(void)
  55. {
  56.     // put your main code here, to run repeatedly:
  57.  
  58. }
  59.  
  60. /* END CODE */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement