Only needs to read a single bit...

I have a project I want to do, and I just need some way for a computer to read a single momentary switch, and then run scripts based on that.

I don’t want to really spend a lot of money for an Arduino when it’s going to be used for such a small function, ya know?

I really have tried searching, but the issue I have has many generic keywords, saturating results.

Does anyone have any suggestions? Help would really be appreciated :-/

Probably you can use microprocessor ATMEGA without arduino?
http://itp.nyu.edu/physcomp/Tutorials/ArduinoBreadboard

The problem with that is that the ATmega is still too powerful for my needs.

I guess my question is: Could suggest a microcontroller that isn’t as powerful, but still able to communicate with a computer? All it needs is to be able to read a momentary high-low.

This could be done easily ages ago using the game port inputs if the motherboard has one, or the printer port inputs.

Now I think Windoze makes it much harder to do.

If you use dos ( :slight_smile: I still do) or Linux( :slight_smile: I do) it is probably a lot easier to do.

I would be willing to switch over to linux if it’s really that much easier.

How can it be done there?

Take a look here Linux I/O port programming mini-HOWTO as a start.

Thanks for that info, but I just realized that Linux wouldn’t be as feasible for two reasons:

  1. I am missing a serial/game/parallel port on the computer, so the IO programming wouldn’t work out.
  2. Some of the programs I would want this switch to control are Windows-only.

Are there any alternatives? Is it really this difficult to read a single bit without a full-blown microcontroller, in windows? :-/

This can still be done using Windows XP as far as I know, but you will need to find a .DLL (INPOUT.DLL ?) file that allows easy hardware port access. It will also probably take ages to get working.

Using the Arduino or a clone , this will take about 5 minutes to get working and cost less than 25 Euros. How valuable is your time? This seems like a bargain to me.

Ya. That’s a good point; but my budget is running thin for this project.

Oh well, thanks for your help. I really appreciated it. :slight_smile:

I am missing a serial/game/parallel port on the computer, so the IO programming wouldn’t work out.

At this point you need something USB based.

You can do it easily enough with a USB → Parallel converter, and read your bit directly from the now present Parallel port.

The cost of one of these, is generally the same as the Arduino, which is why you are going to get that back as an answer over and over again.

Besides… With a little time and creativity a single bit can be made fairly illustrious.

Blink an LED with the bit, or Count bits over time and change blinking rate of Pin13 Led in respect to count, mount a servo behind a picture of a speedometer and position from 0 to 100mph based on rate of bit changes… live it up man! :smiley:

At this point you need something USB based.

No not really.

The problem here is that we are all geared up to think Arduino on the forum after all that’s what it is.

I assume your computer has a serial port. If so then just read one of the control lines on the serial port, say the RTS or the DTR. There are windose commands to do that. So no processor needed at all.

Well he did say this:

  1. I am missing a serial/game/parallel port on the computer, so the IO programming wouldn’t work out.

If you are short on budget consider a usb to parallel port converter. Then you can program it like a parallel port. These converters are very cheap.

The only thing that is even cheaper is a trashed keyboard. You could connect some key that you do not use for other input and read this key.

Cheers, Udo

What is your budget?