Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


kiwis

837 posts

Ultimate Geek
+1 received by user: 12


#69178 4-Oct-2010 21:08
Send private message

I've got a 9pin serial port plug and I'm wanting to use a button to play music, seems easy enough except from a hardware point of view, say my standard button has a output wire how do I connect that to my serial port? this video says PIN 1 and 4, but why?

http://www.youtube.com/watch?v=2MlJCMdD8MU

Don't worry about the .Net I'll sort that out later, I'm just trying to get my head around the hardware stuff for now.

Create new topic
richms
29099 posts

Uber Geek
+1 received by user: 10210

Trusted
Lifetime subscriber

  #387884 4-Oct-2010 21:10
Send private message

because there are limited numbers of handshaking likes you can read on a serial port, and those pins will be some of them.




Richard rich.ms



kiwis

837 posts

Ultimate Geek
+1 received by user: 12


  #387890 4-Oct-2010 21:13
Send private message

Care to explain more in detail?

Gadgetcity
26 posts

Geek


  #387912 4-Oct-2010 21:41

Basically, to detect a button press you need to apply a voltage to an input pin. 
In this case Pin 4 is the source of the voltage. (DTR is normally used to indicate when ready to receive data)
Pin 1 is the input that is read. (CD - Carrier Detect, usually reports a valid modem carrier)

The point is to use a 'signalling' input - not the received data input as this is not designed to read on/off type inputs so it would be difficult to read a button via it.

Another signalling input that could be used would be pin 9, the Ring Indicator. This is normally used to signal that the telephone line is ringing so a modem can answer it if desired.

Hope that helps 



nickb800
2735 posts

Uber Geek
+1 received by user: 829

Trusted

  #387922 4-Oct-2010 21:48
Send private message

kiwis: say my standard button has a output wire how do I connect that to my serial port? this video says PIN 1 and 4, but why?


What sort of button do you have? Typical buttons will have 2 terminals which would pair up to the wires from pins 1 & 4.

If your button only has one terminal, then maybe the case/ground is the other terminal.

Gadgetcity
26 posts

Geek


  #388025 5-Oct-2010 08:10

It depends on how you write your software and what action you want the button to take. If it is a button that initiates music and nothing else then you can use any button but a momentary one makes the most sense.
http://www.dse.co.nz/dse.shop/4caa1d9f00d8cfbe273fc0a87f3b0723/Product/View/P7568

 
 
 
 

Shop now for Lego sets and other gifts (affiliate link).
kiwis

837 posts

Ultimate Geek
+1 received by user: 12


  #388369 5-Oct-2010 17:16
Send private message

i guess i'm looking for it to do more than just that long term it's starting point. Where can I get more info on this?

richms
29099 posts

Uber Geek
+1 received by user: 10210

Trusted
Lifetime subscriber

  #388398 5-Oct-2010 18:19
Send private message

Well there are 4 inputs on a serial port that can take DC signals like that, Carrier detect, Clear to send, DSR, and the ring indicate line. Ring indicate is not there on lots of devices tho since the chips to convert levels have 4 in each direction normally, so that is left out.

You need to take them between - and + 12 volt to be compliant with the specs, but simply between open and one of the other pins will work in most cases if you are happy to have false triggers with noise on the cable occasionally so you check for that in software.




Richard rich.ms

Gadgetcity
26 posts

Geek


  #388403 5-Oct-2010 18:57

It depends what info you are looking for. With regards to .NET you can easily use the PinChanged Event to monitor up to 4 buttons easily.

kiwis

837 posts

Ultimate Geek
+1 received by user: 12


  #389846 9-Oct-2010 11:46
Send private message

How how many buttons?
Should I really use USB with a driver?

I'm wanting to start small with a say small switch boarding to play music maybe then then work up to a model railway switchboard where from my pc I can switch tracks etc?

richms
29099 posts

Uber Geek
+1 received by user: 10210

Trusted
Lifetime subscriber

  #389858 9-Oct-2010 13:17
Send private message

Get an arduino, between that and processing you can do what you need with many many examples targeted at artistes who are not really into hardware and coding, and both are open source too, so there are plenty of clone hardware off enay available really cheap.




Richard rich.ms

Create new topic








Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.