This is a simple project to learn about using the MediaTek LinkIt's Headphone Port royal plat music.
For this project you will need:
- A Solderless Bread Board
- Jumper Wires
- A LED
- A Push Button Switch
Optional - micro SD card to save sound files
Check Out Our Other Accounts! Like, Subscribe, and Follow to keep up to date with our latest projects. :-)
Step 1: Test the Standard State of Your Switch
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.
Step 2: Wiring
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 microphone (usually with control buttons) you may need an adapter or only partially insert it into the headphone Jack.
Step 3: Programming
To play an audio file on the LinkIt One simply format the SD card and directly place all of the sound files onto it.
Use the code below the trigger the sound file (replace the "001.mp3" with the desired exposure length, and the second delay with the desired time between photos).
NOTE: the first "delay" time MUST be longer than exposure time, otherwise the camera will not close the shutter until the program has finished running.
LAudio.playFile( storageSD,(char*)"001.mp3"); //Length of exposure in seconds change file name to suit
Serial.println("1 Second Exposure Triggered");
delay(1000); //Length of Exposure
delay(1000); //Delay Between Photos
Use the "void loop()" command to keep the code repeating. If desired you can also add a loop counter to take only a certain number of photos.
Step 4: Testing
To start or stop recording simply press the switch once.
I am hoping to eventually add a playback or monitor feature to ensure that the microphone is properly recording (before listening to blank mp3's on your computer ;-)
Have a great day! Any suggestions or ideas are welcome in the comments.