Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Parallel Put
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
xiii




PostPosted: Tue Jun 06, 2006 3:40 pm   Post subject: Parallel Put

I have to make this traffic simulation and i was wondering if there is any ting i need to add or if anything is wrong with the program.


Realone.t
 Description:

Download
 Filename:  Realone.t
 Filesize:  4.11 KB
 Downloaded:  323 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Clayton




PostPosted: Tue Jun 06, 2006 4:26 pm   Post subject: (No subject)

hm interesting, never heard of the command parallelput and i dont quite understand what it does, but interesting enough though, its good to see you trying to learn this kind of thing as you never know when it will come in handy Very Happy
[Gandalf]




PostPosted: Tue Jun 06, 2006 6:53 pm   Post subject: (No subject)

I'm pretty sure most people only use that command in some high school engineering course to interface with the parallel port. This allows you to manipulate external devices using Turing.
TheOneTrueGod




PostPosted: Tue Jun 06, 2006 7:46 pm   Post subject: (No subject)

Aye, its for a computer engineering course, and his/her teacher probably taught it to him/her. (I'm not gender discrimantory. Yay Exclamation )

All shenanagins aside, it works similarily to put (If I remember this right), but it sends the binary equivilant of the decimal number you give it.

The parallel port has 8 output pins, some input, some other pins, and some ground pins.

code:

parallelput 16


The above will output 1 0000 to the parallel port, which turns on pin 4 (it starts at pin 0, and goes up from there), turns off pin 3, turns off pin 2, turns off pin 1, and turns off pin 0. (And also turns off any pins above 4, because technically that binary number is actually 0001 0000)

If you connect wires to the respective pins of the parallel port, you can connect them to a breadboard, and have fun things happen, like LEDs being controlled by the computer / keyboard, or switches external to the computer triggering events inside the computer.

You could even make a game based off of your own "keyboard", though the max keys would be 8 (I think), and i've found parallelget to be quite annoying to work with.



Anyways, as for the program, we really have no way to test it, and either way, if you hook it up to your breadboard wrong, no matter how right the program is, it still won't work Razz. You're best bet is to just test it in school, as chances are you will have ample time to do so.
McKenzie




PostPosted: Tue Jun 06, 2006 8:36 pm   Post subject: (No subject)

It's not going to work the way you want it to. Because You have your light changing in an if ... elsif structure that is not in a loop it will only do one branch. So either add a loop, or drop the if. Second you are sending your colour values accross the parallelput. This makes your coding easier, but your wiring harder. I would either limit myself to 2 bits (0 -> 3) or, more likely, send values that only use one line each (1,2,4)
xiii




PostPosted: Tue Jun 06, 2006 8:53 pm   Post subject: (No subject)

Thanks for the tips.
How would you make the ligts change in the turing itself at the same time as the leds light up?
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: