GithubHelp home page GithubHelp logo

dfrobot_iis's Introduction

DFRobot_IIS

Provides an Arduino library for FireBeetle Covers-Camera&Audio Media Board

产品效果图片

DFR0498:FireBeetle Covers-Camera&Audio Media Board

Table of Contents

Summary

The library is used to Play music file from SD card,Record sound and save in SD card,take photo and save in SD card

Installation

To use this library, download the library file and paste it into the \Arduino\ Libraries directory, then open the examples folder and run the demo in that folder.

Methods

  /**
   * @fn init
   * @brief Init function
   * @details Initialize I2S mode, I2S can be used as audio and camera controller in esp32
   * @param mode I2S mode, AUDIO or CAMERA 
   * @return Data of bool type
   * @retval true Init succeeded
   * @retval false Init failed
   */
  bool init(uint8_t mode);

  /**
   * @fn SDCardInit
   * @brief Mount SD card
   * @return Data of bool type
   * @retval true Init succeeded
   * @retval false Init failed
   */
  bool SDCardInit(void);

  /**
   * @fn sendPhoto
   * @brief Send out the photo obtained from the camera via network
   */
  void sendPhoto(void);

  /**
   * @fn setSpeakersVolume
   * @brief Set speakers volume
   * @param volume Volume, range 0-99
   */
  void setSpeakersVolume(uint8_t volume);
  
  /**
   * @fn muteSpeakers
   * @brief Mute speakers
   */
  void muteSpeakers(void);

  /**
   * @fn setHeadphonesVolume
   * @brief Set headphones volume
   * @param volume Volume, range 0-99
   */
  void setHeadphonesVolume(uint8_t volume);
  
  /**
   * @fn muteHeadphones
   * @brief Mute headphones
   */
  void muteHeadphones(void);
  
  /**
   * @fn setFreamsize
   * @brief Set camera pixel
   * @param photoSize  optional (QQVGA,QQVGA2,QICF,HQVGA,QVGA,RGB555,GRAYSCALE)
   * @return Return the set pixel
   */
  uint8_t setFreamsize(uint8_t photoSize);

  /**
   * @fn setPixformat
   * @brief Set color depth
   * @param pixelFormat  RGB555(RGB565 true color), GRAYSCALE(grayscale image)
   * @return Return the set color depth
   */
  uint8_t setPixformat(uint8_t pixelFormat);

  /**
   * @fn snapshot
   * @brief Take photo
   * @param pictureFilename The name of the file to save picture
   */ 
  void snapshot(const char *pictureFilename);
  
  /**
   * @fn connectNet
   * @brief Connect to WIFI
   * @param ssid     WIFI name
   * @param password WIFI password
   */ 
  void connectNet(const char* ssid,const char* password);

  /**
   * @fn initPlayer
   * @brief init music player
   */
  void initPlayer();
  
  /**
   * @fn initRecorder
   * @brief Init recorder
   */
  void initRecorder();

  /**
   * @fn playMusic
   * @brief Play music
   * @param filename The name of the file used to play
   */
  void playMusic(const char *Filename);

  /**
   * @fn record
   * @brief record sound
   * @param filename he name of the file to save record
   */
  void record(const char *Filename);

  /**
   * @fn playerControl
   * @brief Control the music player
   * @param cmd Command to control music player
   * @n    PLAY   Begin or continue play music
   * @n    PAUSE  Pause play music
   * @n    STOP   Stop play music
   */
  void playerControl(uint8_t cmd);

  /**
   * @fn recorderControl
   * @brief Control the recorder
   * @param cmd Command to control recorder
   * @n   BEGIN  Begin recording
   * @n   STOP   Stop recording
   */
  void recorderControl(uint8_t cmd);
  
  /**
   * @fn SDcard_Init
   * @brief Initialize SD card
   * @param mountpoint SD card name
   */
  bool SDcard_Init(const char* mountpoint="/sdcard");

Compatibility

MCU Work Well Work Wrong Untested Remarks
FireBeetle-ESP32
FireBeetle-ESP8266
FireBeetle-BLE4.1

History

  • 2017/9/29 - Version 1.0.0 released.
  • 2022/3/21 - Version 1.0.1 released.

Credits

Written by fengli([email protected]), 2022.3.21 (Welcome to our website)

dfrobot_iis's People

Contributors

chocho2018 avatar gboldwang avatar ndmluckyl avatar pleasetakeup avatar wxzed avatar z43740979 avatar zedwu avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dfrobot_iis's Issues

How to Play MP3 files..

Hello Dear

My Project is Internet RADIO for DFRotot DFR0478 + DFR0498
I See the DFRobot_IIS files -, but this library is only supported wav files..
can i played mp3 file??

image

thanks a lot..

any special Arduino ESP32 core version needed?

With Core 2.0.5 I got

C:\Users\mail\Documents\Arduino\libraries\DFRobot_IIS\src\DFRobot_IIS.cpp: In function 'void recordSound(void*)':
C:\Users\mail\Documents\Arduino\libraries\DFRobot_IIS\src\DFRobot_IIS.cpp:280:22: error: unused variable 'size' [-Werror=unused-variable]
         unsigned int size = 0;
                      ^~~~
C:\Users\mail\Documents\Arduino\libraries\DFRobot_IIS\src\DFRobot_IIS.cpp: In function 'void i2sMcklkInit(unsigned int)':
C:\Users\mail\Documents\Arduino\libraries\DFRobot_IIS\src\DFRobot_IIS.cpp:507:16: warning: 'ledc_timer_config_t::<unnamed union>::bit_num' is deprecated [-Wdeprecated-declarations]
     timer_conf.bit_num       = bit_num;
                ^~~~~~~
In file included from C:\Users\mail\Documents\Arduino\libraries\DFRobot_IIS\src\DFRobot_IIS.h:25,
                 from C:\Users\mail\Documents\Arduino\libraries\DFRobot_IIS\src\DFRobot_IIS.cpp:13:
C:\Users\mail\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.5/tools/sdk/esp32/include/driver/include/driver/ledc.h:49:60: note: declared here
         ledc_timer_bit_t bit_num __attribute__((deprecated)); /*!< Deprecated in ESP-IDF 3.0. This is an alias to 'duty_resolution' for backward compatibility with ESP-IDF 2.1 */
                                                            ^
C:\Users\mail\Documents\Arduino\libraries\DFRobot_IIS\src\DFRobot_IIS.cpp:507:16: warning: 'ledc_timer_config_t::<unnamed union>::bit_num' is deprecated [-Wdeprecated-declarations]
     timer_conf.bit_num       = bit_num;
                ^~~~~~~

and with Core 1.0.6 the error message

In file included from C:\Users\mail\Documents\Arduino\libraries\DFRobot_IIS\examples\playmusic\playmusic.ino:18:0:
C:\Users\mail\Documents\Arduino\libraries\DFRobot_IIS\src/DFRobot_IIS.h:21:28: fatal error: esp32/rom/gpio.h: No such file or directory
compilation terminated.
exit status 1

Is there any special version needed to got it compiling?

How to play its WAV / MP3 file from SD Card

Hi z43740979,
Good Day!

This Brian Chiu from Taiwan.

I use this reference sample code for my project Music Player + Biynk.
However, this sample code cannot play WAV file from SD card even though this sample code compile ok on Ardunio 1.8.3.

Also I find the following information when the PCB is operated by COM port

  1. sdmmc_sd: sdmmc_check_scr: send_scr returned 0x109
  2. Card Mount Failed

I think my problem are SD Card file cannot read and cannot play WAV file.

Can you kindly help me to solve this issue?

Note:
DFR0498 FireBeetle_Covers-Camera&Audio_Media_Board
https://wiki.dfrobot.com/FireBeetle_Covers-Camera&Audio_Media_Board_SKU_DFR0498

Best Regards!
Brian Chiu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.