Computer Science Canada

Parallelput and Parallelget?

Author:  vdemons [ Fri May 27, 2011 3:47 pm ]
Post subject:  Parallelput and Parallelget?

I need to how to use parallelput to turn an LED on from one of the pins of a parallel port. I already read the tutorial (http://compsci.ca/holtsoft/doc/parallelput.html) but I don't understand if an LED is on using "parellelput (2)" [pin 2=on, I think] and if it is, how I would turn it off using another command, and what does it mean by data bit 7-0.

Also one more thing what is parallelget and how do I use it.

Please and thank you in advance!

P.S. how do you turn more than one LED on.

Author:  Tony [ Fri May 27, 2011 3:57 pm ]
Post subject:  RE:Parallelput and Parallelget?

from the same documentation page
Quote:

For example, the command parallelput (97) sets data bits 0, 5 and 6 high (97 = 1 + 32 + 64) and sets the other data pins low. Because there are only 8 data pins in the parallel port, the value passed to parallelput must be from 0 to 255.


Setting a particular pin as "high" means supplying it with a +5v voltage. If it's wired to run through the LED and into the ground, the current will flow and the light will come on.

Since you know what
parallelput does, you can take a guess at how
parallelget works. Then check the documentation to make sure that you have the right ideas (and right pins) -- parallelget

Author:  vdemons [ Fri May 27, 2011 4:11 pm ]
Post subject:  RE:Parallelput and Parallelget?

If thats how you turn it on then how do you turn it off with a command.

Author:  Tony [ Fri May 27, 2011 4:27 pm ]
Post subject:  RE:Parallelput and Parallelget?

set the pin to low

Author:  vdemons [ Fri May 27, 2011 4:30 pm ]
Post subject:  RE:Parallelput and Parallelget?

So would that be parallelput(0)?

Author:  vdemons [ Fri May 27, 2011 4:34 pm ]
Post subject:  RE:Parallelput and Parallelget?

and would parallelget be how you would ground the device or something.


: