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

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




PostPosted: Thu Apr 15, 2004 5:52 pm   Post subject: LEDs?

Ok, does anyone know how to make output on a LED using parallel ports and a breadboard? using turing.
This is an comp engineering question, since my friend doesn't wanna post it herself, I'll post it for her.
I dunno what info is important, but please post all the steps?
I'll give 20 bits to whoever does, and if it works.
and if this doesn't have to be done in turing (aka, a ezier way, tell me pls)
Sponsor
Sponsor
Sponsor
sponsor
Paul




PostPosted: Thu Apr 15, 2004 6:20 pm   Post subject: (No subject)

I assume it has something to do with parallelput, and when I looked up the doc, Im clueless...
gamer




PostPosted: Thu Apr 15, 2004 6:29 pm   Post subject: (No subject)

i kinda learned it so......
theres 25 pins on parallelport, u can hav up to 8 lights (plug to pin 2-9, other pins are for the ground wire)
ok, so after u plug the leds wires into the port (find out which one is ground) , plug the ground one to any pins while the other wire must go into either 2-9 pin
to turn on that specific pin (for power for led), just use parallelput command, if u plug into pin 2, use parallelput (2), if its in pin 4, use parallelput (8) becuz the computer reads binary ( i think u kno how ta convert)

think dats basically it
gamer




PostPosted: Thu Apr 15, 2004 6:34 pm   Post subject: (No subject)

ok heres a pic of the parallel port pins.......the circled pins are 2-9

p.s.: btw, im sry if i made some mistake, like if u pluged in pin2 , command may just be parallelput (1), but i believe it starts at 2 alredi...anyhow later on u'll still hav ta apply binary numbers



pins.JPG
 Description:
just open, no point to dl, cuz i duno how u simply post the pic
 Filesize:  10.27 KB
 Viewed:  4589 Time(s)

pins.JPG


gamer




PostPosted: Thu Apr 15, 2004 6:41 pm   Post subject: (No subject)

ok im sry for the triple post but, i think made one more mistake Embarassed 4get the binary thingys.....

ok imagine the 2-9 pins

0 0 0 0 0 0 0 0 %% if they ar alll off

1 1 1 1 1 1 1 1%%if they ar all on

the base number to turn on the first pin (from right) is 1,then 2, 4, 8, 16, 32, 64, 128

so dependin on which pins u wanna turn on, use parallelput with these numbers

if ya wish to turn on a few leds at the same time then......

let say three leds are placed on pins 2,3,4....then u simply add up 1,2,4 which will be parallelput (7)
Paul




PostPosted: Thu Apr 15, 2004 7:24 pm   Post subject: (No subject)

like can some one tell me the steps? and the code?
gamer




PostPosted: Thu Apr 15, 2004 8:07 pm   Post subject: (No subject)

wut do u mean.......i just told u almost everythin
gamer




PostPosted: Thu Apr 15, 2004 8:22 pm   Post subject: (No subject)

paul, tell me wut exactly u need ta kno

building of the breadboard?conectin breadboard to parallel port? connectin the leds to breadboard? or the turing code to turn on specific pins on the parallel port (if so tell me the pin # then i can give u the exact codes)
Sponsor
Sponsor
Sponsor
sponsor
Paul




PostPosted: Thu Apr 15, 2004 8:35 pm   Post subject: (No subject)

I dunno, like how would one go about doing something that would allow u to input 1 on the keyboard and it would display 1 on the LED?
I just need the general idea of the code.
gamer




PostPosted: Thu Apr 15, 2004 8:49 pm   Post subject: (No subject)

u mean turnin the led on??
well again it depends on which pins u stuck the led wire into (look in the pic i attached, i think u stick the positive wire into one of the 8, n the negative wire to any other ones for ground)

code:
since theres 8 pins:
  %    %    %    %     %    %    %    %   <=the pins
128   64   32   16     8    4    2    1   <=the base number to turn of the specific pin


again, if u wanna turn on a few pins, just add the values together

then simply put that value in
code:
parallelput (8) ===> for example


hope this aint confusin ya
if u still got problems plz ask
Paul




PostPosted: Fri Apr 16, 2004 10:58 pm   Post subject: (No subject)

kk thanx for ur efforts, here are 20 bits, the topic is over, no need for help anymore.
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  [ 11 Posts ]
Jump to:   


Style:  
Search: