On 8/25/2010 9:01 AM, Abuzer Firdousi wrote:
> Hello!
> Parallel port communication in c.
> i am using turbo c++ compiler. and try to blink a led connected on LPT1
> port. but this is not working.
> I need some help related to parrallel port communication in c++.
> LED is connected at 2 and ground pin of LPT1.
>
>
> #include"conio.h"
> #include"dos.h"
>
> #define PORT 0x378
>
> void main()
> {
>      while(!kbhit())
>      {
>          outportb(PORT, ~inportb(PORT) );
>          delay(1000);
>      }
> }

Lose Turbo C.  It is 16-bit and VERY ancient.  Upgrade to a modern 
compiler suite (VC++ 2010).  More than likely it isn't working because 
the OS is blocking the port from being accessed directly like you are 
attempting to do.

-- 
Thomas Hruska
CubicleSoft President

Barebones CMS is a high-performance, open source content management 
system for web developers operating in a team environment.

An open source CubicleSoft initiative.
Your choice of a MIT or LGPL license.

http://barebonescms.com/

  • [c-prog] Abuzer Firdousi
    • Re: [c-prog] Thomas Hruska

Reply via email to