I need advice.. quick!
I have got a simple circuit to control an LED via the parallel port (thru a Turbo C 3.0 program) but i somehow cant manage it...!
the outportb(PORT, value) command doesnt seem to work!!
i connected the +ve leg of the LED to the D5 connector and the -ve leg to the ground (hole 18) of the parallel port... used the outportb() function but nothing happened!!!
what could be the problem? am i connecting the LED in a wrong way??
PS: ALSO LEMME KNOW OF SOME COOL PARALLEL PORT INTERFACING PROGRAMS USING TC 3.0!!! I'M A STUDENT OF BS
2006-10-14
03:21:36
·
3 answers
·
asked by
Shariq M
5
in
Computers & Internet
➔ Programming & Design
um.. and DUH! this is a programming and design section.. i wont be needing help tie my shoes!
2006-10-14
03:32:46 ·
update #1
PS: and i dont find anything funny with 'i'm a student of BS'
2006-10-14
03:41:40 ·
update #2
http://answers.yahoo.com/question/?qid=20061014072136AASxHtc
i have updated my question on the web...
thanks for answering.. that was great..
okay so maybe i'm giving the wrong value or port number..
but this is what i'm using
#include
#include
#include
#define PORT 0x378 /* This is the parallel port address */
main()
{
char val=0,key=0;
char str1[]="ON ";
char str2[]="OFF";
char *str;
while(key!='x' && key!='X')
{
switch(key){
case '1':
gotoxy(9,8);
val=(val&0x01)?(val&(~0x01)):val|0x01;
str=(val&0x01)?str1:str2;
outportb(PORT,val);
break;
.....
......
}
2006-10-14
08:30:57 ·
update #3