LinkItOne IPod Shuffle

by Just4Fun Media in Circuits > Mobile

770 Views, 4 Favorites, 0 Comments

LinkItOne IPod Shuffle

56758ec267400c35d9000006.jpeg

This is a simple project to learn about using the MediaTek LinkIt's Headphone Port to play music.
For this project you will need:

- A Solderless Bread Board

- Jumper Wires

-An LED

- A Push Button Switch

- a micro SD card to save sound files

- Headphones

- A MediaTek LinkItOne

A huge thank you to instructables, autodesk, MediaTek, and Penolopy Bulnick for sending me the Link It One used in this instructable.



Check Out Our Other Accounts! Like, Subscribe, and Follow to keep up to date with our latest projects. :-)

Just4Fun Media Facebook Just4Fun Media Instagram Just4Fun Media Youtube Just4Fun Media Twitter Just4Fun Media Tumblr Just4Fun Media Website

Test the Standard State of Your Switch

photo-2015-10-30, 1:05 PM.jpg
photo-2015-10-30, 1:05 PM.jpg

Usually the standard state of your switch can be found in the data
sheet. Since I salvaged this limit switch off of an old printer I made sure to test it first.

To test the switch you simply need to connect it in series with an LED and connect it to a low voltage source on the LinkIt. My switch had a standard ON state. This will become more important when you begin coding.

Wiring

photo-2015-10-30, 1:05 PM.jpg
photo-2015-10-30, 1:05 PM.jpg
photo-2015-10-30, 1:05 PM.jpg
photo-2015-10-30, 1:05 PM.jpg
photo-2015-10-30, 1:05 PM.jpg
photo-2015-10-30, 1:05 PM.jpg

Run a jumper wire from the digital ground pin (Black), and an LED driver
pin (Red) to two rows on the board. Place the long leg of the LED into the positive row and the short leg into the ground row.

Run two jumpers from two different digital pins (one will be programmed as hot) and connect your switch between them.

The MediaTek LinkIt is designed to work with 2 or 3 wire 3.5mm microphones (Hot, Ground or Left, Right, Ground). If you are using a 4 wire pair of headphones (usually with control buttons) you may need an adapter or only partially insert the cable into the headphone Jack.

Programming

Format a micro SD card into FAT format. Then save the files as .mp3 files directly onto the SD card.
Use the code below to trigger the sound file (replace the "001.mp3" with the name of your files)

1 = "001.mp3"

2 = "002.mp3"

3 = "003.mp3"

Have the program choose a random song.

song = random(1, 3)

When the button is pressed execute the command.

LAudio.setVolume(3); LAudio.playFile( storageSD,(char*)song)

If the button is pressed twice in rapid succession have a new random variable be chosen and another song begin to play.

For testing purposes I set the LED to light up when ever the LAudio command is executed to help with debugging. Luckily this project went smoothly and it was not necessary.

Full code files will be published once I am done debugging the code. I am currently working to expand the maximum number of songs the program can handle before crashing the LinkIt.

Testing

photo-2015-10-30, 1:05 PM.jpg
photo-2015-10-30, 1:05 PM.jpg

To start or stop playing the music simply press the switch once.
Press the switch twice in rapid succession to skip a song.

Any suggestions or ideas are welcome in the comments.

Have a great day! :-)