www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/04/11:38:09

Date: Fri, 4 Apr 1997 08:19:20 -0800 (PST)
From: Orlando Andico <orly AT gibson DOT eee DOT upd DOT edu DOT ph>
Reply-To: Orlando Andico <orly AT gibson DOT eee DOT upd DOT edu DOT ph>
To: Jono Greene <jonog AT eastky DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Parallel Port Program?
In-Reply-To: <01bc40df$f8f93ea0$6e221cce@ppro>
Message-ID: <Pine.SGI.3.93.970404081809.2186A-100000@pauline>
MIME-Version: 1.0

On 3 Apr 1997, Jono Greene wrote:

> I am trying to write a simple program that will turn on a designated pin of
> the parallel port, at a designated time.  I have found the following code,
> but I can't get it to compile under DJGPP:
> 
> #include <stdio.h>
> #include <conio.h>
> #include <time.h>
> 
> void main(void)   
> {                 
> struct time t;
> unsigned port = 0x378;
> while()
>     {
>     gettime(&t);
>     if(t.ti_hour==10 && t.ti_min==05) _outp8(port,1);
>     else _outp8(port,0);
>     }
> }
> 

1. Lose the #include <conio.h>
2. Use outb () instead of _outp8()


-----------------------------------------------------------------------
Orlando Andico                               IRC Lab/EE Dept/UP Diliman
email: orly AT gibson DOT eee DOT upd DOT edu DOT ph          http://gibson.eee.upd.edu.ph
   "There's an obvious attraction to the path of least resistance.."


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019