{"id":290,"date":"2017-06-12T15:06:38","date_gmt":"2017-06-12T15:06:38","guid":{"rendered":"http:\/\/martindebie.com\/workshop\/?p=290"},"modified":"2022-04-07T12:52:38","modified_gmt":"2022-04-07T12:52:38","slug":"memo-arduinolibrairiesdriver","status":"publish","type":"post","link":"https:\/\/martindebie.com\/workshop\/memo-arduinolibrairiesdriver\/","title":{"rendered":"MEMO [arduino\/librairies\/driver]"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">DFRobotDFPlayerMini<\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"501\" src=\"https:\/\/martindebie.com\/workshop\/wp-content\/uploads\/2022\/04\/1aa1326d5f595dc1ad13be8f3fc52a33.png\" alt=\"\" class=\"wp-image-2742\" srcset=\"https:\/\/martindebie.com\/workshop\/wp-content\/uploads\/2022\/04\/1aa1326d5f595dc1ad13be8f3fc52a33.png 800w, https:\/\/martindebie.com\/workshop\/wp-content\/uploads\/2022\/04\/1aa1326d5f595dc1ad13be8f3fc52a33-300x188.png 300w, https:\/\/martindebie.com\/workshop\/wp-content\/uploads\/2022\/04\/1aa1326d5f595dc1ad13be8f3fc52a33-768x481.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p><a href=\"https:\/\/wiki.dfrobot.com\/DFPlayer_Mini_SKU_DFR0299\">https:\/\/wiki.dfrobot.com\/DFPlayer_Mini_SKU_DFR0299<\/a><\/p>\n\n\n\n<p>TAB 1<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: arduino; title: ; notranslate\" title=\"\">\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n#include &quot;Arduino.h&quot;\n#include &quot;SoftwareSerial.h&quot;\n#include &quot;DFRobotDFPlayerMini.h&quot;\n\nSoftwareSerial mySoftwareSerial(10, 11); \/\/ RX, TX\nDFRobotDFPlayerMini myDFPlayer;\n\nint bouton = 11;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid printDetail(uint8_t type, int value);\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid setup() {\n  \n  mySoftwareSerial.begin(9600);\n  \n  Serial.begin(115200);\n\n  Serial.println();\n  Serial.println(F(&quot;DFRobot DFPlayer Mini Demo&quot;));\n  Serial.println(F(&quot;Initializing DFPlayer ... (May take 3~5 seconds)&quot;));\n\n  if (!myDFPlayer.begin(mySoftwareSerial)) {  \/\/Use softwareSerial to communicate with mp3.\n    Serial.println(F(&quot;Unable to begin:&quot;));\n    Serial.println(F(&quot;1.Please recheck the connection!&quot;));\n    Serial.println(F(&quot;2.Please insert the SD card!&quot;));\n    while (true);\n  }\n  \n  Serial.println(F(&quot;DFPlayer Mini online.&quot;));\n  myDFPlayer.volume(10);  \/\/Set volume value (0~30).\n  myDFPlayer.setTimeOut(500); \/\/Set serial communictaion time out 500ms\n  myDFPlayer.EQ(DFPLAYER_EQ_NORMAL);\n  myDFPlayer.outputDevice(DFPLAYER_DEVICE_SD);\n\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nvoid loop() {\n\nint boutonValeur = digitalRead(bouton);\n\n  if (boutonValeur == 1) {\n    myDFPlayer.play(1); \n    delay (1000);\n  }\n  \n  Serial.println(boutonValeur);\n}\n\n<\/pre><\/div>\n\n\n<p>TAB 2<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: arduino; title: ; notranslate\" title=\"\">\n\n  \/\/----Set volume----\n\/\/  myDFPlayer.volume(10);  \/\/Set volume value (0~30).\n\/\/  myDFPlayer.volumeUp(); \/\/Volume Up\n\/\/  myDFPlayer.volumeDown(); \/\/Volume Down\n\n  \/\/----Set different EQ----\n\/\/  myDFPlayer.EQ(DFPLAYER_EQ_NORMAL);\n\/\/  myDFPlayer.EQ(DFPLAYER_EQ_POP);\n\/\/  myDFPlayer.EQ(DFPLAYER_EQ_ROCK);\n\/\/  myDFPlayer.EQ(DFPLAYER_EQ_JAZZ);\n\/\/  myDFPlayer.EQ(DFPLAYER_EQ_CLASSIC);\n\/\/  myDFPlayer.EQ(DFPLAYER_EQ_BASS);\n\n  \/\/----Set device we use SD as default----\n\/\/  myDFPlayer.outputDevice(DFPLAYER_DEVICE_U_DISK);\n\/\/  myDFPlayer.outputDevice(DFPLAYER_DEVICE_SD);\n\/\/  myDFPlayer.outputDevice(DFPLAYER_DEVICE_AUX);\n\/\/  myDFPlayer.outputDevice(DFPLAYER_DEVICE_SLEEP);\n\/\/  myDFPlayer.outputDevice(DFPLAYER_DEVICE_FLASH);\n\n  \/\/----Mp3 control----\n\/\/  myDFPlayer.sleep();     \/\/sleep\n\/\/  myDFPlayer.reset();     \/\/Reset the module\n\/\/  myDFPlayer.enableDAC();  \/\/Enable On-chip DAC\n\/\/  myDFPlayer.disableDAC();  \/\/Disable On-chip DAC\n\/\/  myDFPlayer.outputSetting(true, 15); \/\/output setting, enable the output and set the gain to 15\n\n  \/\/----Mp3 play----\n\/\/  myDFPlayer.next();  \/\/Play next mp3\n\/\/  delay(1000);\n\/\/  myDFPlayer.previous();  \/\/Play previous mp3\n\/\/  delay(1000);\n\/\/  myDFPlayer.play(1);  \/\/Play the first mp3\n\/\/  delay(1000);\n\/\/  myDFPlayer.loop(1);  \/\/Loop the first mp3\n\/\/  delay(1000);\n\/\/  myDFPlayer.pause();  \/\/pause the mp3\n\/\/  delay(1000);\n\/\/  myDFPlayer.start();  \/\/start the mp3 from the pause\n\/\/  delay(1000);\n\/\/  myDFPlayer.playFolder(15, 4);  \/\/play specific mp3 in SD:\/15\/004.mp3; Folder Name(1~99); File Name(1~255)\n\/\/  delay(1000);\n\/\/  myDFPlayer.enableLoopAll(); \/\/loop all mp3 files.\n\/\/  delay(1000);\n\/\/  myDFPlayer.disableLoopAll(); \/\/stop loop all mp3 files.\n\/\/  delay(1000);\n\/\/  myDFPlayer.playMp3Folder(4); \/\/play specific mp3 in SD:\/MP3\/0004.mp3; File Name(0~65535)\n\/\/  delay(1000);\n\/\/  myDFPlayer.advertise(3); \/\/advertise specific mp3 in SD:\/ADVERT\/0003.mp3; File Name(0~65535)\n\/\/  delay(1000);\n\/\/  myDFPlayer.stopAdvertise(); \/\/stop advertise\n\/\/  delay(1000);\n\/\/  myDFPlayer.playLargeFolder(2, 999); \/\/play specific mp3 in SD:\/02\/004.mp3; Folder Name(1~10); File Name(1~1000)\n\/\/  delay(1000);\n\/\/  myDFPlayer.loopFolder(5); \/\/loop all mp3 files in folder SD:\/05.\n\/\/  delay(1000);\n\/\/  myDFPlayer.randomAll(); \/\/Random play all the mp3.\n\/\/  delay(1000);\n\/\/  myDFPlayer.enableLoop(); \/\/enable loop.\n\/\/  delay(1000);\n\/\/  myDFPlayer.disableLoop(); \/\/disable loop.\n\/\/  delay(1000);\n\n  \/\/----Read imformation----\n\/\/  Serial.println(myDFPlayer.readState()); \/\/read mp3 state\n\/\/  Serial.println(myDFPlayer.readVolume()); \/\/read current volume\n\/\/  Serial.println(myDFPlayer.readEQ()); \/\/read EQ setting\n\/\/  Serial.println(myDFPlayer.readFileCounts()); \/\/read all file counts in SD card\n\/\/  Serial.println(myDFPlayer.readCurrentFileNumber()); \/\/read current play file number\n\/\/  Serial.println(myDFPlayer.readFileCountsInFolder(3)); \/\/read fill counts in folder SD:\/03\n\n<\/pre><\/div>\n\n\n<p>TAB 3<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: arduino; title: ; notranslate\" title=\"\">\nvoid printDetail(uint8_t type, int value){\n  switch (type) {\n    case TimeOut:\n      Serial.println(F(&quot;Time Out!&quot;));\n      break;\n    case WrongStack:\n      Serial.println(F(&quot;Stack Wrong!&quot;));\n      break;\n    case DFPlayerCardInserted:\n      Serial.println(F(&quot;Card Inserted!&quot;));\n      break;\n    case DFPlayerCardRemoved:\n      Serial.println(F(&quot;Card Removed!&quot;));\n      break;\n    case DFPlayerCardOnline:\n      Serial.println(F(&quot;Card Online!&quot;));\n      break;\n    case DFPlayerPlayFinished:\n      Serial.print(F(&quot;Number:&quot;));\n      Serial.print(value);\n      Serial.println(F(&quot; Play Finished!&quot;));\n      break;\n    case DFPlayerError:\n      Serial.print(F(&quot;DFPlayerError:&quot;));\n      switch (value) {\n        case Busy:\n          Serial.println(F(&quot;Card not found&quot;));\n          break;\n        case Sleeping:\n          Serial.println(F(&quot;Sleeping&quot;));\n          break;\n        case SerialWrongStack:\n          Serial.println(F(&quot;Get Wrong Stack&quot;));\n          break;\n        case CheckSumNotMatch:\n          Serial.println(F(&quot;Check Sum Not Match&quot;));\n          break;\n        case FileIndexOut:\n          Serial.println(F(&quot;File Index Out of Bound&quot;));\n          break;\n        case FileMismatch:\n          Serial.println(F(&quot;Cannot Find File&quot;));\n          break;\n        case Advertise:\n          Serial.println(F(&quot;In Advertise&quot;));\n          break;\n        default:\n          break;\n      }\n      break;\n    default:\n      break;\n  }\n}\n<\/pre><\/div>\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-57f56f8c-12cb-4f17-9074-8eee4ca79db4\" href=\"https:\/\/martindebie.com\/workshop\/wp-content\/uploads\/2022\/04\/DFPlayer-Mini-MP3-Player.zip\">DFPlayer-Mini-MP3-Player<\/a><a href=\"https:\/\/martindebie.com\/workshop\/wp-content\/uploads\/2022\/04\/DFPlayer-Mini-MP3-Player.zip\" class=\"wp-block-file__button\" download aria-describedby=\"wp-block-file--media-57f56f8c-12cb-4f17-9074-8eee4ca79db4\">Download<\/a><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">DRIVER <strong>ch340g<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/martindebie.com\/workshop\/wp-content\/uploads\/2017\/06\/51wgi3dH-RL._SY355_.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"355\" height=\"355\" src=\"https:\/\/martindebie.com\/workshop\/wp-content\/uploads\/2017\/06\/51wgi3dH-RL._SY355_.jpg\" alt=\"\" class=\"wp-image-291\" srcset=\"https:\/\/martindebie.com\/workshop\/wp-content\/uploads\/2017\/06\/51wgi3dH-RL._SY355_.jpg 355w, https:\/\/martindebie.com\/workshop\/wp-content\/uploads\/2017\/06\/51wgi3dH-RL._SY355_-150x150.jpg 150w, https:\/\/martindebie.com\/workshop\/wp-content\/uploads\/2017\/06\/51wgi3dH-RL._SY355_-300x300.jpg 300w\" sizes=\"auto, (max-width: 355px) 100vw, 355px\" \/><\/a><\/figure>\n\n\n\n<p><strong>ch340g<\/strong> mac-os-x-driver for arduino nano clone<\/p>\n\n\n\n<p><a href=\"https:\/\/martindebie.com\/workshop\/wp-content\/uploads\/2022\/03\/CH34XSER_MAC.zip\">ch340g-ch34g-ch34x-mac-os-x-driver-master<\/a> (M1 chip)<\/p>\n\n\n\n<p>source from <a href=\"https:\/\/github.com\/WCHSoftGroup\/ch34xser_macos\">github<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>DFRobotDFPlayerMini https:\/\/wiki.dfrobot.com\/DFPlayer_Mini_SKU_DFR0299 TAB 1 TAB 2 TAB 3 DRIVER ch340g ch340g mac-os-x-driver for arduino nano&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-290","post","type-post","status-publish","format-standard","hentry","category-7"],"_links":{"self":[{"href":"https:\/\/martindebie.com\/workshop\/wp-json\/wp\/v2\/posts\/290","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/martindebie.com\/workshop\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/martindebie.com\/workshop\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/martindebie.com\/workshop\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/martindebie.com\/workshop\/wp-json\/wp\/v2\/comments?post=290"}],"version-history":[{"count":5,"href":"https:\/\/martindebie.com\/workshop\/wp-json\/wp\/v2\/posts\/290\/revisions"}],"predecessor-version":[{"id":2745,"href":"https:\/\/martindebie.com\/workshop\/wp-json\/wp\/v2\/posts\/290\/revisions\/2745"}],"wp:attachment":[{"href":"https:\/\/martindebie.com\/workshop\/wp-json\/wp\/v2\/media?parent=290"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/martindebie.com\/workshop\/wp-json\/wp\/v2\/categories?post=290"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/martindebie.com\/workshop\/wp-json\/wp\/v2\/tags?post=290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}