Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Computer Interface - Twelve switches

Status
Not open for further replies.

Clyd3

New Member
Hi, I need to turn on and off twelve little switches - or transistors from my pc. I would input either a list of states (12 ones and zeros) or tell the computer to try all combinations from one particular to another.

Interface:
Requiring all of the twelve transistors to change state (each according to program) once every 1.5 seconds or so isn't so intensive.
What would be the best interface for me to use? Parallel port? USB?

Software: This is an electronics forum, so i don't expect step by step help in coding this - and i enjoy problem solving. But is there a library or code example in c or python or similar showing how to change the state of say, one of the pins on a parallel port to make it hot? Using that i could string together a couple functions some nice variables and a little command line interface to let me guide it.
Is there a simpler, very straight forward way of doing this?

This is why, if you care:
I've got quite a couple PICs handy, but the reason i want to interface to a pc, is for more interaction, saving of sequences and determining the final or actual value, which is obtained in a brute force fashion. The computer would say change the combinations in a sequence, and if i tell it, "HEY! It just worked!" then my it would make a shortlist of the last couple ones tried. Trying those combinations again, i can determine what state each of the twelve need to be and save it for future reference.
 
hi clyd.

Look at this zip.
Place the *.dll s in the windows\system folder.

It may give you an idea.

You will need the Visual Basic 5 runtime files from the web, free.
 
Last edited:
hi clyd.

Look at this zip.
Place the *.dll s in the windows\system folder.

It may give you an idea.

You will need the Visual Basic 5 runtime files from the web, free.
Looks quite interesting that. So those pins, are they continuously on / or off as set by that app? (or is it sending some form of data?).
It seems too good to be true...

Since you've got some PICs, just use RS232 and treat the PIC as a RS232 latch.
Been looking at tutorials at microchip in c. Some good stuff there on this that i should look into, but if that little vb thing eric showed is as i hope, that'll seriously save some time...

Btw, python rocks the treehouse :D
 
hi clyd,

Looks quite interesting that. So those pins, are they continuously on / or off as set by that app? (or is it sending some form of data?).
It seems too good to be true...

The select buttons on the VB5 module Set/Clear [ High/Low] the state of the PC's parallel port pins. The state of the pin is indicated by the Red/Green colour of the pin box shown on the module.

The read option scans the input pins about once/sec and displays the state of the pin on the module.

NOTE: some parallel port pins are 'inverted'.

The VB5 source code included in the zip can easy be modified to suit your application.
 
Thank you very much. I think it's time to get started then. Shot!
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top