PC controler
Author |
Message |
giuseppe105
|
Posted: Sat May 23, 2009 3:11 pm Post subject: PC controler |
|
|
What is it you are trying to achieve?
I am trying to make a controller for my computer using the parallel port.
What is the problem you are having?
I dont know how to use the Parrnell port in Turing.
Describe what you have tried to solve this problem
Google for hours on end, No luck.
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Turing: |
ParallelPut()
ParallelGet()
|
Please specify what version of Turing you are using
4.1.1 |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
zero-impact
![](http://compsci.ca/v3/uploads/user_avatars/872397874480c7089d4888.gif)
|
|
|
|
![](images/spacer.gif) |
Homer_simpson
![](http://compsci.ca/v3/uploads/user_avatars/18138546704b4d2a3b2e50e.gif)
|
Posted: Sat May 23, 2009 5:53 pm Post subject: Re: PC controler |
|
|
pins 2 to 9 are outputs, theres 8 of them you can control them by PC.ParallelPut(1,byte)
the byte value is an integer from 0 up to 255. 0 is 00000000 and 255 is 11111111. lets say if you wanted to send power to pins 2 and 4 you would use PC.ParallelPut(1,5) as 5 = 00000101
pins 18 to 25 are ground.
there's a pretty good article here: http://www.hardwaresecrets.com/article/233 |
|
|
|
|
![](images/spacer.gif) |
giuseppe105
|
Posted: Sat May 23, 2009 6:17 pm Post subject: Re: PC controler |
|
|
thanks for the reply's someone in my engineering class tried to explain the parallel thing i didn't understand it im going to see if i can understand what you trying to tell me.
I need to know how to do this because its the cheapest way to make a controller. If i used a USB i would need some chip that costs money so...
With parallel put can i make a program that lets me press keys on the keyboard when i press buttons on the controller.
Im using some controller that has the game built inside of it. and i have no idea how to make the computer know its there and how to use it.
If you know any links or threads that can explain how to do this from the ground up it would be much appreciated.
Thank you ahead of time! |
|
|
|
|
![](images/spacer.gif) |
Homer_simpson
![](http://compsci.ca/v3/uploads/user_avatars/18138546704b4d2a3b2e50e.gif)
|
Posted: Sun May 24, 2009 3:08 am Post subject: Re: PC controler |
|
|
well try reading the article i sent you. it should explain a lot basically you have 8 outputs which gives you the option of 8 on(one) and off(zero). therefore you have
1 1 1 1 1 1 1 1 = all outputs are on
0 1 0 0 1 0 0 0 = out put 2 and 5 are on
so basically you have a binary number(base 2) change it into a decimal(base 10) and you get the number you put into PC.ParallelPut function. for example 00000010=2 and 11111111=255
i'm not sure if that helped let me know what exactly u need help on |
|
|
|
|
![](images/spacer.gif) |
giuseppe105
|
Posted: Sun May 24, 2009 11:09 am Post subject: Re: PC controler |
|
|
wait i think i got it. so what your saying is.
8 7 6 5 4 3 2 1
0 0 0 0 0 0 0 0 are all switches and if i wanted to turn on output 2 then i would use
0 0 0 0 0 0 1 0
the only thing is i need to get information from the controller. And to top it off my laptop wont let me run my program it says my parallel port drivers are not installed correctly but it works i can put a printer in it and everything.
I'm going to try it on another computer instead of messing around with the laptop. |
|
|
|
|
![](images/spacer.gif) |
Homer_simpson
![](http://compsci.ca/v3/uploads/user_avatars/18138546704b4d2a3b2e50e.gif)
|
Posted: Sun May 24, 2009 11:22 pm Post subject: Re: PC controler |
|
|
from the turing help file:
"5. Using the Parallel Ports in Turing 4
Under Turing 4.0 and , it is possible to access the IBM PC's parallel port for reading and writing. This is normally done using the parallelput and parallelget commands. (In Turing 4.0, you can use PC.ParallelPut and PC.ParallelGet to access ports other than LPT1.)
Under Windows 95/98 and Me, the operating system allows direct access to the parallel port. Under Windows NT, 2000 and XP, access to the parallel port is restricted by the operating system. In order to access the port, under Windows NT, 2000 and XP, it is necessary to install a device driver on each machine that will be accessing the parallel port. The needed device driver installer is located at:
[Turing directory]\support\dlportio_install.exe
where [Turing directory] is the directory in which Turing was installed. Executing this program will install the device driver in the Windows System directory of the machine upon which it is executed.
Lastly, before accessing the parallel port, check that the parallel port is in normal mode and not in bi-directional, PS/2, EPP or ECP mode. You can determine which mode the parallel port is in using the Device Manager. In the list of devices in the Device Manager window, double click Ports (COM and LPT), and then the LPT (or PRN) port. This displays a property sheet about the parallel port. Take a look at what it says about it. If it is in a non-original mode (i.e. mentions bi-directional, PS/2, EPP or ECP mode), then you will probably need to adjust the systems BIOS settings.
(Under Windows 2000 the Device Manager can be displayed by selecting the System Control Panel from Settings in the Start menu. Select the Hardware tab and then click the Device Manager button.)
If the setting for the parallel port needs to be changed, restart the machine, and press the appropriate key to enter the BIOS Set Up Program (the key varies between machines, but is usually noted on the screen). Often the parallel port settings are found in Advanced Settings of the program. The parallel port should be set to Normal, Standard, AT or Unidirectional mode. (All four names are different descriptions of the same mode.) Once this is done and the new settings are saved, then start the machine into Windows. Once in Windows, select Shut Down and turn the machine completely off. Once the machine is off, wait at least 10 seconds in the powered-off state. Then restart the machine. (While shutting down the machine should not be necessary, we have had several cases where the change only took when the machine had been powered-down and restarted.)
" |
|
|
|
|
![](images/spacer.gif) |
|
|