Computer Science Canada Controlling a robot with the arrow keys through the paralleput function? |
Author: | kinian [ Mon May 19, 2008 10:32 am ] |
Post subject: | Controlling a robot with the arrow keys through the paralleput function? |
I have been assigned a project to control a robot with two motors which are connected to the computer with the parallel port cable. I must find a way to control the robot with the arrow keys, (so forward, back, left, right, and a combination of those). I need some help corresponding the parallelput function with user-input arrow keys (this would be implemented into the GUI) . How would I go about creating something like this? Thank you for your help in advance. |
Author: | kinian [ Wed May 21, 2008 5:10 pm ] |
Post subject: | Re: Controlling a robot with the arrow keys through the paralleput function? |
bump |
Author: | HeavenAgain [ Wed May 21, 2008 5:27 pm ] | ||
Post subject: | RE:Controlling a robot with the arrow keys through the paralleput function? | ||
i am assuming you would use 4 pins from your cable to set this up that being said, you need to understand how does parallelput work in binary, which i think is 8 bits of info (for 8 pins) and you will need 4 of those, you could set it up like
the rest all comes down to your coding, with loop and ifs, just like how you normally make a game (if you've never made a game with arrow keys, look up on the submission or tutorial to help you out) |
Author: | kinian [ Sat May 24, 2008 8:24 pm ] | ||
Post subject: | Re: Controlling a robot with the arrow keys through the paralleput function? | ||
I don't really understand what you meant by your code, could you elaborate a bit? This is what I have so far, I've decided to use the Input.KeyDown (key) command, but I can't seem to correspond it to the "KEY_UP_ARROW" :
|
Author: | richcash [ Sun May 25, 2008 3:28 pm ] |
Post subject: | Re: Controlling a robot with the arrow keys through the paralleput function? |
Is your Input.KeyDown inside a loop? If you want it to continuously check for input it has to be in a loop. |
Author: | kinian [ Sun May 25, 2008 6:18 pm ] | ||
Post subject: | Re: Controlling a robot with the arrow keys through the paralleput function? | ||
Yes, thanks I just realized that, also, I would be using pins 2,3,4,5 for the two motors, which parallelput (X) corresponds to these pins? I'm kind of lost there. I'll post the code I have so far, there are many errors regarding the parallelput function I'm sure. Thanks for your help!
|