This shows you the differences between two versions of the page.
pm:prj2023:apredescu:mp3_player [2023/05/30 14:29] antonio.stan [Download] |
pm:prj2023:apredescu:mp3_player [2023/05/30 15:30] (current) antonio.stan [Download] |
||
---|---|---|---|
Line 60: | Line 60: | ||
* If the next button is pressed, it plays the next track. | * If the next button is pressed, it plays the next track. | ||
* If the previous button is pressed, it plays the previous track. | * If the previous button is pressed, it plays the previous track. | ||
- | * Calls getSongDuration() to retrieve and display song duration information. | ||
* Playback functions: | * Playback functions: | ||
Line 72: | Line 71: | ||
* execute_CMD() function: | * execute_CMD() function: | ||
* Calculates the checksum and builds the command line to send to the MP3 module. | * Calculates the checksum and builds the command line to send to the MP3 module. | ||
- | |||
- | * getSongDuration() function: | ||
- | * Sends a command to the MP3 module to retrieve the current track's duration. | ||
- | * Reads the response from the MP3 module and extracts the duration and remaining duration information. | ||
- | * Updates the LCD display with the song duration and remaining duration. | ||
===== Results ===== | ===== Results ===== | ||
Line 90: | Line 84: | ||
* If you press the previous button (buttonPrevious) while playing a track, it will play the previous track. The LCD display will not update with the song duration or remaining duration. | * If you press the previous button (buttonPrevious) while playing a track, it will play the previous track. The LCD display will not update with the song duration or remaining duration. | ||
- | 3. Song Duration Display: | + | 3. Song Name Display: |
- | * The getSongDuration() function is called in the loop() function, but it is currently commented out (//getSongDuration();). Therefore, the song duration and remaining duration will not be displayed on the LCD screen. | + | * At the beginning, I declared two matrixes that contained the songs and the respective artists in order for them to be displayed on the LCD screen. |
===== Conclusions ===== | ===== Conclusions ===== | ||
Line 97: | Line 91: | ||
- MP3 Module Integration: The project successfully integrates an MP3 module with an Arduino board using the SoftwareSerial library. The module is controlled using specific commands sent via the software serial communication. | - MP3 Module Integration: The project successfully integrates an MP3 module with an Arduino board using the SoftwareSerial library. The module is controlled using specific commands sent via the software serial communication. | ||
- Playback Control: The code enables basic playback control functionalities such as play, pause, next track, and previous track. The buttons connected to the Arduino board trigger these playback commands. | - Playback Control: The code enables basic playback control functionalities such as play, pause, next track, and previous track. The buttons connected to the Arduino board trigger these playback commands. | ||
- | - LCD Display: The project utilizes a LiquidCrystal library to interface with an LCD display. The display is initialized and shows fixed text for "Duration:" and "Remaining:". However, the code for updating the duration and remaining duration on the LCD screen is incomplete or commented out. | + | - LCD Display: The project utilizes a LiquidCrystal library to interface with an LCD display. The display is initialized and shows fixed text for "Artist" and "Song". |
- Volume Control: The code includes a function to set the volume of the MP3 module. By calling the setVolume() function with a specified volume level, the volume of the playback can be adjusted. | - Volume Control: The code includes a function to set the volume of the MP3 module. By calling the setVolume() function with a specified volume level, the volume of the playback can be adjusted. | ||
- Serial Communication: The code establishes serial communication between the Arduino board and the MP3 module. It sends command sequences consisting of start bytes, command bytes, parameter bytes, and checksum bytes to control the module's behavior. | - Serial Communication: The code establishes serial communication between the Arduino board and the MP3 module. It sends command sequences consisting of start bytes, command bytes, parameter bytes, and checksum bytes to control the module's behavior. | ||
Line 104: | Line 98: | ||
===== Download ===== | ===== Download ===== | ||
- | {{:pm:prj2023:apredescu:stanantonio-valentin_1221a_mp3-player.zip|}} | + | |
+ | {{:pm:prj2023:apredescu:stanantoniovalentin_1221a_mp3.zip|}} | ||