Mail Archives: djgpp/1997/04/04/11:38:09
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 -