{"id":3378,"date":"2023-03-11T06:15:02","date_gmt":"2023-03-11T14:15:02","guid":{"rendered":"https:\/\/www.donluc.com\/?p=3378"},"modified":"2023-03-11T06:15:02","modified_gmt":"2023-03-11T14:15:02","slug":"project-16-sound-sparkfun-protoshield-kit-mk23","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=3378","title":{"rendered":"Project #16: Sound &#8211; SparkFun ProtoShield Kit &#8211; Mk23"},"content":{"rendered":"<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-3378-1\" width=\"720\" height=\"480\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/03\/DL2301Mk04W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/03\/DL2301Mk04W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/03\/DL2301Mk04W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#DonLucElectronics #DonLuc #Sound #Arduino #MicroOLED #ProtoShield #SparkFunQwiicMP3 #SparkFunRedBoardQwiic #Project #Programming #Electronics #Microcontrollers #Consultant<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/03\/DL2301Mk04a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/03\/DL2301Mk04a.png\" alt=\"SparkFun ProtoShield Kit\" width=\"720\" height=\"516\" class=\"alignnone size-full wp-image-3380\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/03\/DL2301Mk04a.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/03\/DL2301Mk04a-300x215.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/03\/DL2301Mk04b.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/03\/DL2301Mk04b.png\" alt=\"SparkFun ProtoShield Kit\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3381\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/03\/DL2301Mk04b.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/03\/DL2301Mk04b-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/03\/DL2301Mk04c.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/03\/DL2301Mk04c.png\" alt=\"SparkFun ProtoShield Kit\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3382\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/03\/DL2301Mk04c.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/03\/DL2301Mk04c-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>SparkFun ProtoShield Kit<\/strong><\/p>\n<p>The SparkFun ProtoShield Kit lets you customize your own Arduino shield using whatever circuit you can come up with and then test it to make sure everything is working the way it should. The SparkFun ProtoShield Kit is based off the Arduino R3\u2019s footprint that allows you to easily incorporate it with favorite Arduino-based device.<\/p>\n<p>One of our favorite features with this version of the ProtoShield Kit is the solderable-like breadboard prototyping area. Half of this area was designed with a breadboard in mind. On the underside of the shield you will be able to see open jumper pads between each through hole to make a connection like a breadboard. Once you add a component, simply add a solder jumper between holes to make a connection. For those that prefer the standard prototyping pads.<\/p>\n<p><strong>DL2301Mk04<\/strong><\/p>\n<p>1 x SparkFun RedBoard Qwiic<br \/>\n1 x SparkFun ProtoShield Kit<br \/>\n1 x SparkFun Micro OLED Breakout (Qwiic)<br \/>\n1 x SparkFun Qwiic MP3 Trigger<br \/>\n1 x microSD Card &#8211; 2GB<br \/>\n1 x Panel Mount 10K potentiometer<br \/>\n1 x Knob<br \/>\n2 x Rocker Switch &#8211; SPST (Round)<br \/>\n1 x Qwiic Cable &#8211; 50mm<br \/>\n1 x Qwiic Cable &#8211; 100mm<br \/>\n1 x Dayton Audio Reference 3&#8243; Full-Range Drive<br \/>\n1 x SparkFun Cerberus USB Cable<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>SparkFun RedBoard Qwiic<\/strong><\/p>\n<p>PO1 &#8211; Analog A0<br \/>\nSDA &#8211; Analog A4<br \/>\nSCL &#8211; Analog A5<br \/>\nSW0 &#8211; Digital 8<br \/>\nSW1 &#8211; Digital 7<br \/>\nVIN &#8211; +5V<br \/>\nVIN &#8211; +3.3V<br \/>\nGND &#8211; GND<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>DL2301Mk04p.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/* ***** Don Luc Electronics \u00a9 *****\r\nSoftware Version Information\r\n#16 - Sound - SparkFun ProtoShield Kit - Mk23\r\n16-04\r\nDL2301Mk04p.ino\r\n1 x SparkFun RedBoard Qwiic\r\n1 x SparkFun ProtoShield Kit\r\n1 x SparkFun Micro OLED Breakout (Qwiic)\r\n1 x SparkFun Qwiic MP3 Trigger\r\n1 x microSD Card - 2GB\r\n1 x Panel Mount 10K potentiometer\r\n1 x Knob\r\n2 x Rocker Switch - SPST (Round)\r\n1 x Qwiic Cable - 50mm\r\n1 x Qwiic Cable - 100mm\r\n1 x Dayton Audio Reference 3&quot; Full-Range Drive\r\n1 x SparkFun Cerberus USB Cable\r\n*\/\r\n\r\n\/\/ Include the Library Code\r\n\/\/ Wire communicate with I2C \/ TWI devices\r\n#include &lt;Wire.h&gt;\r\n\/\/ SparkFun MP3 Trigger\r\n#include &quot;SparkFun_Qwiic_MP3_Trigger_Arduino_Library.h&quot;\r\n\/\/ SparkFun Micro OLED\r\n#include &lt;SFE_MicroOLED.h&gt;\r\n\r\n\/\/ SparkFun MP3 Trigger\r\nMP3TRIGGER mp3;\r\nint iSongCount = 0;\r\nint x = 0;\r\n\r\n\/\/ Volume\r\nint iVolume = A0;\r\nint iVolumeLevel = 0;\r\n\r\n\/\/ EQ Setting Normal\r\nbyte bEQSetting = 0;\r\n\r\n\/\/ Play Next\r\nconst int iPlayNext = 8;\r\n\/\/ Variable for reading the iPlayNext status\r\nint iPlayNextState = 0;\r\n\r\n\/\/ Play Previous\r\nconst int iPlayPrevious = 7;\r\n\/\/ Variable for reading the iPlayPrevious status\r\nint iPlayPreviousState = 0;\r\n\r\n\/\/ SparkFun Micro OLED\r\n#define PIN_RESET 9\r\n#define DC_JUMPER 1\r\n\/\/ I2C declaration\r\nMicroOLED oled(PIN_RESET, DC_JUMPER);\r\n\r\n\/\/ iLED ProtoShield\r\nint iLED = 13;\r\n\r\n\/\/ Software Version Information\r\nString sver = &quot;16-23&quot;;\r\n\r\nvoid loop()\r\n{\r\n    \r\n  \/\/ SparkFun MP3 Trigger\r\n  if (mp3.isPlaying() == false) {\r\n\r\n    if ( x &gt; iSongCount ) {\r\n\r\n      x = 0;\r\n      \r\n    } else {\r\n\r\n      x = x + 1;\r\n      \r\n    }\r\n    \r\n    \/\/ Play Track\r\n    mp3.playTrack( x );\r\n\r\n  } else {\r\n\r\n    \/\/ Volume\r\n    isVolume();\r\n\r\n    \/\/ Play Next\r\n    isPlayNext();\r\n\r\n    \/\/ Play Previous\r\n    isPlayPrevious();\r\n\r\n  }\r\n\r\n  \/\/ Micro OLED\r\n  isMicroOLED();\r\n    \r\n}\r\n<\/pre>\n<p><strong>getMP3.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ MP3\r\n\/\/ Setup MP3\r\nvoid isSetupMP3(){\r\n\r\n  \/\/ Check to see if Qwiic MP3 is present on the bus\r\n  if (mp3.begin() == false)\r\n  {\r\n    \r\n    \/\/ Qwiic MP3 failed to respond. Please check wiring and possibly the I2C address. Freezing...\r\n    while (1);\r\n    \r\n  }\r\n\r\n  if (mp3.hasCard() == false)\r\n  {\r\n    \r\n    \/\/ Qwiic MP3 is missing its SD card. Freezing...\r\n    while (1);\r\n    \r\n  }\r\n\r\n  \/\/ Song Count\r\n  iSongCount = mp3.getSongCount();\r\n\r\n  \/\/ EQ Setting\r\n  \/\/ 0 Normal\r\n  \/\/ 1 Pop\r\n  \/\/ 2 Rock\r\n  \/\/ 3 Jazz\r\n  \/\/ 4 Classic\r\n  \/\/ 5 Bass\r\n  bEQSetting = 5;\r\n  bEQSetting = mp3.getEQ();\r\n\r\n  \/\/ Initialize the iPlayNext\r\n  pinMode( iPlayNext, INPUT);\r\n\r\n  \/\/ Initialize the iPlayPrevious\r\n  pinMode( iPlayPrevious, INPUT);\r\n\r\n}\r\n\/\/ Volume\r\nvoid isVolume() {\r\n\r\n  \/\/ Volume\r\n  iVolumeLevel = analogRead( iVolume );\r\n  \/\/ (0-1023 for 10 bits or 0-4095 for 12 bits)\r\n  iVolumeLevel = map(iVolumeLevel, 0, 1023, 0, 10);\r\n\r\n  \/\/ Volume can be 0 (off) to 31 (max)\r\n  \/\/ Volume can be 0 (off) to 10 (Breakfast)\r\n  mp3.setVolume( iVolumeLevel );\r\n  \r\n}\r\n\/\/ Play Next\r\nvoid isPlayNext() {\r\n\r\n  \/\/ Read the state of the iPlayNext value\r\n  iPlayNextState = digitalRead( iPlayNext );\r\n\r\n  if ( iPlayNextState == HIGH ) {\r\n\r\n    mp3.stop();\r\n    \r\n    if ( x &gt; iSongCount ) {\r\n\r\n      x = 0;\r\n      \r\n    } else {\r\n\r\n      x = x + 1;\r\n      \r\n    }\r\n    \r\n    \/\/ Play Track\r\n    mp3.playTrack( x );  \r\n    \r\n  } \r\n\r\n}\r\n\/\/ Play Previous\r\nvoid isPlayPrevious() {\r\n\r\n  \/\/ Read the state of the iPlayPrevious value\r\n  iPlayPreviousState = digitalRead( iPlayPrevious );\r\n\r\n  if ( iPlayPreviousState == HIGH ) {\r\n\r\n    mp3.stop();\r\n    \r\n    if ( x &gt; iSongCount ) {\r\n\r\n      x = 0;\r\n      \r\n    } else {\r\n\r\n      x = x - 1;\r\n      \r\n    }\r\n    \r\n    \/\/ Play Track\r\n    mp3.playTrack( x );\r\n    \r\n  } \r\n\r\n}\r\n<\/pre>\n<p><strong>getMicroOLED.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ SparkFun Micro OLED\r\n\/\/ Setup Micro OLED\r\nvoid isSetupMicroOLED() {\r\n\r\n  \/\/ Initialize the OLED\r\n  oled.begin();\r\n  \/\/ Clear the display&#039;s internal memory\r\n  oled.clear(ALL);\r\n  \/\/ Display what&#039;s in the buffer (splashscreen)\r\n  oled.display();\r\n\r\n  \/\/ Delay 1000 ms\r\n  delay(1000);\r\n\r\n  \/\/ Clear the buffer.\r\n  oled.clear(PAGE);\r\n  \r\n}\r\n\/\/ Micro OLED\r\nvoid isMicroOLED() {\r\n\r\n  \/\/ Text Display FreeIMU\r\n  \/\/ Clear the display\r\n  oled.clear(PAGE);\r\n  \/\/ Set cursor to top-left\r\n  oled.setCursor(0, 0);\r\n  \/\/ Set font to type 0\r\n  oled.setFontType(0);\r\n  \/\/ Song\r\n  oled.print(&quot;Song&quot;);\r\n  \/\/ Song Name\r\n  oled.setCursor(0, 13);\r\n  String songName = mp3.getSongName();\r\n  oled.print( songName );\r\n  \/\/ Song Count\r\n  oled.setCursor(0, 24);\r\n  oled.print(&quot;Song Count&quot;);\r\n  \/\/ Song Count\r\n  oled.setCursor(0, 37);\r\n  iSongCount = mp3.getSongCount();\r\n  oled.print( iSongCount );\r\n  oled.display();\r\n\r\n}\r\n<\/pre>\n<p><strong>setup.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Setup\r\nvoid setup()\r\n{\r\n   \r\n  \/\/ Initialize digital pin iLED ProtoShield as an output\r\n  pinMode(iLED, OUTPUT);\r\n  \/\/ Turn the LED on (HIGH is the voltage level)\r\n  digitalWrite(iLED, HIGH);\r\n  \r\n  \/\/ Wire communicate with I2C \/ TWI devices\r\n  Wire.begin();\r\n\r\n  \/\/ SparkFun MP3 Trigger Setup\r\n  isSetupMP3();\r\n\r\n  \/\/ Setup Micro OLED\r\n  isSetupMicroOLED();\r\n\r\n}\r\n<\/pre>\n<p>&#8212;&#8212;<\/p>\n<p><strong>People can contact us:<\/strong> https:\/\/www.donluc.com\/?page_id=1927<\/p>\n<p><strong>Technology Experience<\/strong><\/p>\n<ul>\n<li>Programming Language<\/li>\n<li>Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc&#8230;)<\/li>\n<li>IoT<\/li>\n<li>Wireless (Radio Frequency, Bluetooth, WiFi, Etc&#8230;)<\/li>\n<li>Robotics<\/li>\n<li>Camera and Video Capture Receiver Stationary, Wheel\/Tank and Underwater Vehicle<\/li>\n<li>Unmanned Vehicles Terrestrial and Marine<\/li>\n<li>Machine Learning<\/li>\n<li>RTOS<\/li>\n<li>Research &#038; Development (R &#038; D)<\/li>\n<\/ul>\n<p><strong>Instructor, E-Mentor, STEAM, and Arts-Based Training<\/strong><\/p>\n<ul>\n<li>Programming Language<\/li>\n<li>IoT<\/li>\n<li>PIC Microcontrollers<\/li>\n<li>Arduino<\/li>\n<li>Raspberry Pi<\/li>\n<li>Espressif<\/li>\n<li>Robotics<\/li>\n<\/ul>\n<p><strong>Follow Us<\/strong><\/p>\n<p><strong>Luc Paquin \u2013 Curriculum Vitae &#8211; 2023<\/strong><br \/>\nhttps:\/\/www.donluc.com\/luc\/<\/p>\n<p><strong>Web:<\/strong> https:\/\/www.donluc.com\/<br \/>\n<strong>Facebook:<\/strong> https:\/\/www.facebook.com\/neosteam.labs.9\/<br \/>\n<strong>YouTube:<\/strong> https:\/\/www.youtube.com\/@thesass2063<br \/>\n<strong>Twitter:<\/strong> https:\/\/twitter.com\/labs_steam<br \/>\n<strong>Pinterest:<\/strong> https:\/\/www.pinterest.com\/NeoSteamLabs\/<br \/>\n<strong>Instagram:<\/strong> https:\/\/www.instagram.com\/neosteamlabs\/<\/p>\n<p><strong>Don Luc<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8212;&#8212; #DonLucElectronics #DonLuc #Sound #Arduino #MicroOLED #ProtoShield #SparkFunQwiicMP3 #SparkFunRedBoardQwiic #Project #Programming #Electronics #Microcontrollers #Consultant &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; SparkFun ProtoShield Kit The SparkFun ProtoShield Kit lets you customize your own Arduino shield using whatever circuit you can come up with and then test it to make sure everything is working the way it should. The &#8230; <a title=\"Project #16: Sound &#8211; SparkFun ProtoShield Kit &#8211; Mk23\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=3378\" aria-label=\"Read more about Project #16: Sound &#8211; SparkFun ProtoShield Kit &#8211; Mk23\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[119,50,49,61,38,59,5,58,10,43],"tags":[6,102,4,87,19,85,24,9,27,120,109,275,33,34],"class_list":["post-3378","post","type-post","status-publish","format-standard","hentry","category-sound","category-arduino","category-consultant","category-dayton","category-digitalelectronics","category-fritzing","category-microcontrollers","category-arduino-programming","category-projects","category-sparkfun","tag-arduino","tag-components","tag-consultant","tag-display","tag-electronics","tag-fritzing","tag-microcontroller","tag-programming","tag-projects-2","tag-sound","tag-sparkfun","tag-sparkfun-protoshield-kit","tag-technology","tag-video-blog"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3378","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3378"}],"version-history":[{"count":2,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3378\/revisions"}],"predecessor-version":[{"id":3645,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3378\/revisions\/3645"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3378"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}