Homemade Caugh Syrup

405

5

About: Work until you no longer have to introduce yourself.

Linkit One - Music Player

In the last instructable I showed you how to get started with the Linkit One and how to set up your Arduino to program the arduino IDE. The Linkit one certainly has more possibilities than just blink an LED, it has on board WiFi, GSM, GPRS and lots more.
It also has a 3.5mm audio jack and an SD Card so that got me thinking if you could play media from your Linkit One and turns out you can so in this instructable I'm going to show you How to convert your Linkit One to a media player.

Step 1: Components Required

Here is what you will need to get started with this project

  • Linkit One
  • Micro USB Cable
  • A pair of Earphones with 3.5mm Jack
  • Micro SD Card

Step 2: Uploading Code

To upload programs to Linkit One you will need the arduino IDE, you can download it from Arduino official website. And after you download it you need to navigate to Preferences in the arduino File Menu.

In Additional Boards Manager URLs enter

http://download.labs.mediatek.com/package_mtk_linkit_index.json

Then go to the tools and select the board manager After that search for Linkit One and you should have it working

Then copy the code from below and then upload it to the board, make sure you have the right COM port and board selected before uploading the code.

#include #include #define file_name (char *)"xyz.mp3" // change this to the song you want to play

void play(char * filename) { LAudio.setVolume(5); LAudio.playFile(storageSD, filename); Serial.print("Playing: "); Serial.println(filename); delay(5000); }

void setup() { Serial.begin(9600); while (!Serial); Serial.println("Initializing SD Card..."); LSD.begin(); Serial.println("Card Initialized!"); }

void loop() { play(file_name); }

Step 3: Inserting SD Card

Load up a few MP3 files or Wav files on to your SD card and then plug it into you Linkit One, make sure you enter your file name in the code from the previous step.

play('Your File name');

Step 4: Plugin in Earphones

Now that you have everything ready before you power on the board plug in a pair of headphones and set the on board switch from SPI to SD. And you should here your music play when you switch on your linkit One.

Going Further..

Hope you had fun building the Media player, In a future Instructable I will show you how to add a IR remote to control the song being played and have more Control options for the Media player.

If you have any queries, feel free to leave a comment below or PM me and I would try to help you.

Share

    Recommendations

      • Big and Small Contest

        Big and Small Contest
      • Baking Challenge

        Baking Challenge
      • First Time Author

        First Time Author

      Discussions