[Q] Button input through the GPIO port - Raspberry Pi Q&A, Help & Troubleshooting

For my first experiment with the Pi I plan on getting soon, I want to make some kind of mobile music player. I want to be able to, in the end, have buttons that play/pause, skip and go back to the previous track, random, and repeat using the GPIO. I was curious as to if this was possible?
This is my first project doing anything including programming or configuring something along these lines in any way, heard a bunch about the Pi and figured it would help get me started. Any help would be appreciated.

undeadstreamer1 said:
For my first experiment with the Pi I plan on getting soon, I want to make some kind of mobile music player. I want to be able to, in the end, have buttons that play/pause, skip and go back to the previous track, random, and repeat using the GPIO. I was curious as to if this was possible?
This is my first project doing anything including programming or configuring something along these lines in any way, heard a bunch about the Pi and figured it would help get me started. Any help would be appreciated.
Click to expand...
Click to collapse
Your best bet would probably be to use the python module RPi.GPIO to control the RPi's GIPO's. I would recommend checking out Ada Fruits guide to install the RPi.GPIO module, as well as their tutorial about Playing Sounds and Using Buttons on the RPi. Other resources that would be worth taking a look at is Ada Fruits GIPO setup guide and this tutorial on Buttons and Switches with the RPi. Good luck with your project :good:.

Check out my guides at raspberrypi-resources.tk.

Related

Wired Headset mapped to voice command?

if we can get the bluetooth headset then why not the wired headset?
I agree fully...i need the wired headset for my motorcycle...i need to be able to access voice command from my wired headset button. There must be a way to do this!
I've written an app to do this, but it's not released yet. One day... gotta turn it into something useful.
V
There are many people looking for a program that'll do it.
There is a program that seems to work for some (talk button detector), but doesn't for many.
When you release the program, where will we be able to find it, vijay555?
Thanks
If and when it's released, it'll be on my website. But it's likely to take a while because I want to mash it together with some other features and functions, and I'm writing some other intensive apps first.
What do you need the app to do, just launch another specified app?
V
Thanks for the reply Vijay.
The only feature I seem to need would be running a voice dialer application like Voice Speed Dial that comes with MDA, or Voice Commander, so that I can not only receive but also make calls through the wired headset. Maybe while the voice application is running, pressing the button again should close the application.
My original Cingular Rom had this function, so did another one i flashed later(can't remember specific). Sadly most Roms do not support this. Talkbutton seemed like the answer but didn't work for me. I also tried a cab from the Hermes section, but no success on 8125.
Perhaps someone could extract the files from one of the official Roms, or Vijay555 could, perhaps, share some info on this, when he is free, as he seems to be the only one that has this figured out.
Thanks in advance
I'm afraid I'm not in a position to share info on it right now, it's some R&D I did a while back but I haven't had a chance to chase it up further yet to turn it into an app. Once I do, I'll need to tighten it up into a more comprehensive app. I will do it though.
I'll try to look into it soon, maybe a standalone is possible.
V
i remember having a panasonic walkman, an old fashioned tape player, yet it was nice. one of it's best features was a remote with only one button, that reacted to long/single/double/tripple press with acordingly: reverse, pause/play, FF, REV. this was great, and times was like 1995? wish i could do it with wizard's talkbutton, i was hoping to find an app like this, but no luck so far. vijay, i really believe you can do this... and it has been a while since you last posted here, maybe theres been some progress on your work? (sorry if i sound demanding
The app works as far as I need to it to, but it would benefit from a single button driven "interface", eg one click = launch app, two clicks = close app etc.
However, I've been out of the scene for a few months, and will not be back until the New Year. After that I'll try to start getting back into research.
V
Good thing to hear! I'm waiting patiently.
Of course it is obvious but i'll ask; would it be customisable?
i know it would be easy to implement config for actions like launching other programs or closing specific ones... i don't dare to hope for something like sending messages to different apps like tcpmp that would allow to switch tracks or other things... i guess i'll try to figure it out myself, but with my poor knowledge of WM api it will be rather a disaster ;]

I Need Ideas - Raphael Programming

Hello all,
I recently started a course here at Purdue University on Mobile Software development (Windows Mobile).
I need some ideas for programs I should write. Please reply to this thread or PM me if you'd like.
I have experience with C#, VB, C++, and C, among other languages.
Thanks
Jason Flittner
how about a dedicated xda forum app?
How about a sports ticker. I'm still surprised there isn't one yet.
BTW, I think I saw a xda app when I was poking around the other night.
I'm trying to think of ideas but my minds drawing a blank...
Here's the XDApp
Gonna expose my nerdiness here, but you asked...
How about an app that accesses the D&D Insider online compendium of rules and data? Not sure what would be involved, but I'm betting that there's no API available, so it'll probably never happen.
OTOH, it would be nice to see a really high quality dice-rolling app that takes full advantage of the g-sensor and the hardware accelerated graphics...something that looks like dice inside a tumbler, you know? Maybe start with a really slick Yahtzee-style game, and build up to polyhedral dice for us game-geeks?
I'd be happy to provide you with some guidelines for building. I'm sure we could find you a suitably good graphics guy, too, if you're not up to that part (I could do that, in a pinch).
I want my phone to do this:
But until then, I would like to see an ap like Skype, but for mobile that will easily switch you from cellular network to VOIP.
I have two ideas:
#1 - I don't know if this is even possible, but an application that turns on WIFI and/or Bluetooth in a receive only mode briefly every few seconds and listens for user selected devices in range and then performs user selected actions.
The idea is that the it would use less power than leaving WIFI and/or Bluetooth on all the time, but when I get in range of my wifi router at home, it turn WIFI fully on and sync my phone. Or when I'm in range of the WiFi at work, it could turn my ringer to vibrate. Or when I get into the car, it detect my Bluetooth stero, connects to it, and opens the music player.
#2 - Probably simpler than #1, a program that turns WiFi and/or Bluetooth on automatically when the phone is plugged into a charger and then performs specific user defined actions, similar to idea #1.
I don't know if programs like this already exist, but I haven't found them.
Dylan
I like these ideas, please keep them coming. I am not sure what the requirements will be as far as our programming projects are concerned but from what I understand I have alot of freedom in project choices!
I am in another robotics programming class working with the iRobot Creates and I was thinking it would be really sweet to program something that could allow the 2 to interact in some way/shape/form!
I am also very excited about GPS technology I wouldn't mind programming something that would utilize the GPS or triangulation!
Thanks for the contributions all, please keep them coming!
~JFlitt
With all that programing skill you could create some pretty neat apps.
Ive always liked the windows desktop interface.
How about a windows xp-like launcher?
Complete with movable desktop icons, windows, etc.
I am aware that wisbar advance desktop allows you to do this, but alot of those skins are a hassle, and they are not very complete. Plus they dont exactly take advantage of any 3d graphic drivers..
But anyways back to the point, with a windows xp desktop like interface it would be easier to use the phone.
I would not have to stretch my thumb all the way to the top left of the phone.
Oh and you could possibly utilize the touch pros capacitive touch panel for controlling the mouse.
You could also get google android working with more functionality. I am aware that there is work being done on it, but someone with so much programing knowledge could really speed up the project.(Im android crazy)
Or, if all that is too much to complete in limited time, then how about an application that will allow multi touch using the touch panel?
And also, resistive touch screens are supposedly multi touch capable.
I hope i gave you enough ideas.
Good luck.
madfatter said:
how about a dedicated xda forum app?
Click to expand...
Click to collapse
ye s a facebook like app
But would love to see a app recreate the zoombar
on my tp
VOIP
Hi,
I have an idea and it is possible.
how about having an app on your phone to configure your SIP provider settings in it ( 5 different proxy ) and then when you want to dial a number, you can right click on it and chose " voip dial ".
Skype already gives you a the menu for skype calls when u right click on your contact .
if you can add a menu to TF3D settings->communication->VOIP and we can add 5 different proxy in it and we can activate more than one proxy at the same time in order to RECEIVE AND DIAL voip calls from our phone it would be awesome since microsoft is not allowing this kind of apps on marketplace .
Tnx
Thunder
a good "made for raphael" nes or snes emulator would be great since all the other ones out there are out dated and seem to work grat on old phones but are horribly laggy on the touch pro...wierd... the only good one ive found is a jap build of nester (nesterj4u) built for an hp phone or pda im not sure but the keyboard slides out to the right so landscape mode is upside down when i want to use the keyboard >_<
a good streaming media app thats a bit easyer to use than the one that comes with the phone would be great with some tv links on it like surfthechannel or tvdome would be great.
a youporn app to copliment the youtube app would be awsome
hmmm a good compass that simply points north (true or magnetic) with degrees would be awsome for when i drop mine on the roof trying to point my sat.
a simple freeware level would also be awsome since ive only found trialware levels so far
an hourglass would be a fun pointless app for when i get bored of pouring digital beer.
a goofy clip art picture editor could be fun just to mess with. maybe with some fish eye lens and carnival mirror opptions would be fun.
a free streaming radio app would be cool too....
sorry for the long list cant sleep ... figured the more ideas the better
ps. im not sure if any of these already exist havent checked lately so if anyone know if they do feal free to point me in the right direction it would be greatly appreciated
ok, I'm gonna try to have this make sense, but no guarantees. how about a simple titanium plugin framework? something that **doesn't** use mortscript? as mscript is good for certain things, it's not for others. this way there is an easier way for developers to make new plugins for it without having to use a slow scripting language. does that make any sense?
How about a talking GPS
I was out on my mountain bike today. I have a Garmin unit on the handle bars for navigation and listening to music from my Touch Pro in my pocket.
I was riding a fast downhill section through the some trees when I realized I was taking my eyes off the trail to make sure I was still on course.
I've used this http://www.basicgps.co.uk/ for Geocaching but it can only take you to one waypoint at a time. You can't use it to follow a route.
How about making an application which can steer you along a route using voice commands.
(Tomtom and others can only do this on roads, not off-road)
mixture of gps and accelerometer
well can u create an app the tells u ur speed while u are travelling like there is one app which does it in i phone it uses motion sensing and gps there are apis for both you can code it in c# with .net fw 3.5 and if u require help i am available i too know c# .
sound control
What about an app. that would control all of the sound feature such as the ear speaker,speaker phone speaker,and possibily microphone independitly,like bass,trebl,vol. That way a person could tailor the phone to sound the way they want it to sound when they are talking on it or whatever.
Just a thought.
Programing Ideas
A project that I have been toying with is a "Now" button for the calendar. Those of us in consulting need a simple and quick way to insert the current time in the Start Time and End Time field, which ever is selected. I've not been successful so far.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HARDWARE: AT&T HTC FUZE (Raphael)
Hard-SPL: AT&T
ROM: AT&T
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
How about that app the iPhone has where you can transfer contacts by putting the phones next to each other and shaking it to transfer or sliding it across to the other phone.
All for now will think of more
*edit* Forget this its kind of pointless when we can send contacts via sms/IR beam
How about the ability to use our Fuze's as remote controls like you could with PDA's, open your garage door, turn on your 360 or TV, forgot to turn your laptop off, send it a signal to shut down from anywhere
There're some cool applications on Android. One application changes the ringtone based on GPS location. It sets ringtone to loud at home, lower the volume in office and automatically sets the phone to vibration when you are in a theater.
Another application is about setting alarm based on location. You can set an alarm about buying some stuff in a store, next time when you pass by the store, alarm goes off.

noob needs help coding app

Ok so I've never coded in java before its all new to me and i am trying to make an app that would do the same as this (check it out here) old Motorola razr mod, the led's and screens would flash in a pattern when music was played or any vibration into the microphone. I thought this idea could make a cool app for android, so i have begun coding it, and i have pretty much got the interface setup, but when it comes to making the slider i added actually do anything i have no idea and i have no idea how to make buttons actually preform an action, also i have no idea how to go about controlling hardware on the phone like the microphone and various lights to flash. Is there any way anyone can help or give some tips i appreciate any input. Thus far my layout consist of a spinner to chose the different patterns for the lights to flash, then the start button, then a slider to choose how sensitive the microphone is to incoming vibrations. They do nothing yet cause i am not quite sure where to go from here. If you feel you can contribute any knowledge my way i will be grateful, the only coding i have done is minor html stuff although not much different than the xml code involved i have no idea what to do for the java part. Please Help.
Thank you much!
There really isn't anything one could contribute to your knowledge if you don't have experience with an object oriented language like Java. You will need to hop on Google and look at Java tutorials and possibly some object oriented design books. Once you have a good grasp on Java you can then begin learning the API's for Android that Google provides.
So if you're looking for a suggestion there is mine.
Steps you should take
Learn object oriented programming (OOP)
Learn Java
Learn the Android API
thank you, will do.
Yeah man if all you know is minor html you have a lot to learn since theres almost no relation there. I started to learn some java a couple years ago but lost any time for it but when I was learning the best way I found to learn apart from actually taking a class was AppDev. I had the J2SE and J2ME learning programs. Its as close to being in a class room as you can get. There is an instructor, exercises, tests ect. Basically the Rosetta stone for programing.
Do the Hello, World! demos on the official Android site, and take a look at the APIDemos included in the SDK- there's lots of short code samples demonstrating things like buttons and sliders.
And I disagree with the prior poster- learn Java, then OOP. The explanations of object oriented programming will just confuse you until you have some coding practice.
thank you all for the advice, its nice to see that people care enough to help out a noob around here lol
I was a noob to android awhile ago too, though now I'm finalizing a falling sand game for the market =D.
I had experience in c++, c, and html when I first started looking at android. What helped the most was going throught he examples and copying and pasting code into my code until I could figure out how stuff works. The android developers section on www.android.com helped alot, espcially the guide and refrence tabs. I also did a google code search to find the source of another android project that I could reference off of.
It also helps a lot if you have another person that you can work with, it's a lot harder to get discouraged that way.
One last suggestion, use the android-developers forums from google, there's a lot of really good help there. The stack overflow website is also really helpful if you have a general question about java, but not android in specific.
Good luck!
Will be glad to help you along your way once you start coding it. I can write an example app that does all the flashing bits for you. Would have to make it play off the internal media player though and not external audio. Not sure I could code it to do exactly what they did in the video.
Whatever you do, don't ready the notepad toturial that is way advanced and confusing. I highly recommend the hello views tutorials as well as reading the application fundamentals and all the stuff in that category of the dev guide, I forget what its called. But just reading will only get you so far, just try things one at a time. Also #android-dev on freenode ca be a ton of help if your there at the right time, but sometimes its tottaly dead....
There are a ton of awesume tutorials on android-dev's website reading the code there allways helps me understand how new ideas work. But as mentioned earlyer you really need to know oop programing and java...

If I wanted to change how the volume key music control worked... (AOKP ICS)

Ok, before I start on this, I am expecting someone to flame me. Please, I look forward to your flames. Call me a noob, but you never learn without asking questions. Also, I want to learn more about Android, and custom roms (Beyond just flashing them) and this seems like a good way to get started.
I want to change the volume music control incorporated into AOKP so that if I hold volume down, it will play/pause. (As apposed to skip back) As far as I know this cannot be done within the UI, so if I want to step outside the UI, get my hands dirty in some code.... How do I start?
This may at least point you towards the correct files. You'll need a C++ editor to do it. It's by no means a "flame-worthy" question IMO because it involves really deep editing of the /system partition and is a peculiar request.
http://forum.xda-developers.com/archive/index.php/t-1585309.html
I don't think this is the exact method because IDT it's written for a Moto phone or similar actions (wake vs. skip), but just swapping out a few clauses here and there for different functions may work... Who knows! Make some edits, recompile the .apk, make a nand, flash the .zip, and see what happens.

Would like to Dev for W8, have ideas, more places to start?

Hello All,
I have two small App Idea's that I want to implement on the Windows Phone 8 platform. The problem is I'm a little unsure where to start for resources.
The issue however is that for all the Dev resources MS has given us, they mostly start at weird points and has no or little impact on where I want to, or figured one should start. So stuff like, setting up a DB, or Using an Azure Server etc.
If not that, most other help I've found have been off point starting as well. XDA's own vids start off with OAuth etc, which are all great, but I'm not even near there yet for what I want to do.
Most other guides, like even MS's own recent JumpStart videos all hop and skip over certain things. So you're following along (Or I'm trying to) and they jump forward, skip tasks and pull out pre-done code so I assume I need different foundation before I can jump in at their stage.
So, I have my idea of what I want to do, buttons, calculator, lists. But I don't know how to start from some basic things. And I am a little reluctant to jump in to what they have for WP7 cuz I don't want to use anything that's been deprecated.
Thanks in advance for any and all help.
Check out LinkedIn. I started a group a long time ago for Windows Phone developers and enthusiasts. It's filled with programmers, Microsoft people, and there's lots of good references and people to ask.
McHale said:
Check out LinkedIn. I started a group a long time ago for Windows Phone developers and enthusiasts. It's filled with programmers, Microsoft people, and there's lots of good references and people to ask.
Click to expand...
Click to collapse
Thanks for the reply, any specific link to this LinkedIn... I gotta admit, I never thought of LinkedIn as a place for help in this kind of thing...
As an update though, I already have started on the app I had in mind and now have some specific "How-do-I" questions, but undure where to post these. Thanks again however.
Here's the group. There are some pretty active members who are programmers.
http://www.linkedin.com/groups?gid=124767
-Mc
As weird as it may sound: I would suggest you get a beginners book on programming C# on the Desktop. That way you should learn to program from the ground up and get a solid foundation on how the language works (classes, properties, attributes, events, etc.)
Everything else later on is different libraries you will use. That is what most of the introductory videos are about. They show you which classes you use for certain functionality, how you properly wire everything up so it works together.
When you have the basics of how C# works (and most current programming languages like Java but also Objective-C or C++ share the same concepts although there are differences) the best way would be to start with a small project and ask questions when you get stuck or first have a look at StackOverflow if the same question has already been asked and answered.
Teaching someone how to program from the ground up in a forum only rarely works in my experience. But the previous poster might have had different experiences.

Categories

Resources