아두이노 > Sparkfun-MP3-Player-Shield-Arduino-Library/SFEMP3Shield/Examples/FilePlayer/FilePlayer.ino

TODAY635 TOTAL608,636
사이트 이용안내
Login▼/회원가입
최신글보기 질문게시판 기술자료 동영상강좌

아두이노 센서 ATMEGA128 PWM LED 초음파 AVR 블루투스 LCD UART 모터 적외선


BASIC4MCU | 아두이노 | 아두이노 | Sparkfun-MP3-Player-Shield-Arduino-Library/SFEMP3Shield/Examples/FilePlayer/FilePlayer.ino

페이지 정보

작성자 키트 작성일2017-09-11 16:49 조회691회 댓글0건

본문

 




/**
* \file FilePlayer.ino
*
* \brief Example sketch of using the MP3Shield Arduino driver, with flexible list of files and formats
* \remarks comments are implemented with Doxygen Markdown format
*
* \author Bill Porter
* \author Michael P. Flaga
*
* This sketch listens for commands from a serial terminal (such as the Serial
* Monitor in the Arduino IDE). Listening for either a single character menu
* commands or an numeric strings of an index. Pointing to a music file, found
* in the root of the SdCard, to be played. A list of index's and corresponding
* files in the root can be listed out using the 'l' (little L) command.
*
* This sketch allows the various file formats to be played: mp3, aac, wma, wav,
* fla & mid.
*
* This sketch behaves nearly identical to MP3Shield_Library_Demo.ino, but has
* extra complicated loop() as to recieve string of characters to create the
* file index. As the Serial Monitor is typically default with no CR or LF, this
* sketch uses intercharacter time out as to determine when a full string has
* has been entered to be processed.
*/
#include <SPI.h>
//Add the SdFat Libraries
#include <SdFat.h>
#include <SdFatUtil.h>
//and the MP3 Shield Library
#include <SFEMP3Shield.h>
// Below is not needed if interrupt driven. Safe to remove if not using.
#if defined(USE_MP3_REFILL_MEANS) && USE_MP3_REFILL_MEANS == USE_MP3_Timer1
#include <TimerOne.h>
#elif defined(USE_MP3_REFILL_MEANS) && USE_MP3_REFILL_MEANS == USE_MP3_SimpleTimer
#include <SimpleTimer.h>
#endif
/**
* \brief Object instancing the SdFat library.
*
* principal object for handling all SdCard functions.
*/
SdFat sd;
/**
* \brief Object instancing the SFEMP3Shield library.
*
* principal object for handling all the attributes, members and functions for the library.
*/
SFEMP3Shield MP3player;
int16_t last_ms_char; // milliseconds of last recieved character from Serial port.
int8_t buffer_pos; // next position to recieve character from Serial port.
//------------------------------------------------------------------------------
/**
* \brief Setup the Arduino Chip's feature for our use.
*
* After Arduino's kernel has booted initialize basic features for this
* application, such as Serial port and MP3player objects with .begin.
* Along with displaying the Help Menu.

댓글 0

조회수 691

등록된 댓글이 없습니다.

아두이노HOME > 아두이노 > 전체 목록

게시물 검색

2019년 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월
2018년 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월
Privacy Policy
MCU BASIC ⓒ 2017
모바일버전으로보기