One of the coolest features (At least I think so) of the linkit one is the 3mm audio jack. This BUILT-IN feature allows anyone to easily plug in any old speaker they have around their home (or a pair of headphones) and quickly play some tunes. The problem is that there isn't any physical built-in volume switch, which can be a drag sometimes. You might want to control the volume to turn it up or down.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: What You Shall Require
For this volume control project, we'll need
A linkit one board
A Rotary Angle Sensor
A pair of headphones to test it out on!
Step 2: Connect the Rotary Angle Sensor
We'll use a Groove Rotary angle sensor for this project. This is a good idea since the LinkIT ONE has a grove slot built in. This allows you to plug something in and not have to deal with all those wires and solder!
Plug the Rotary Angle Sensor into the Groove slot and you are good to go!
Step 3: Hook Up Your Speaker
I had an old Bose speaker laying around that I use normally. That is kind of defeating the purpose though because it has volume controls built in! Instead, for this project, I will use some headphones. Headphones are a good use case because if the volume is too loud, you want to turn it down right away so you don't blow an ear drum! Yikes!
Just plug in your headphones to the 3mm jack on your linkit one and you are ready to go!
Step 4: To the Code!
Time for Code! Yey! The code here will use the angle of the rotary angle sensor (real tough stuff here, I know) to determine what the volume should play at. We can just use a bunch of if statements to match the angle to a certain volume level.
From what I have seen online, the linkit one seems to only go till volume to 10, and the angle sensor measures from 0 to 300. Thus, we will change the volume every 30 degrees!
Step 5: Enjoy Your Music at an Acceptable Level!
Plug in those earbuds and enjoy your music at a level that is louder than a church mouse but quieter than a jet engine! You did it! Hopefully this project introduced you to some wicked cool features of the linkit one and will help you with future tinkering habits in the future.