| Visual C++ source
code
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
_outp(0x378,0);
_sleep(1000);
_outp(0x378,1);
_sleep(1000);
return 0;
}
Description
This example uses the _outp() function
in Visual C++ , this takes 2 parameters
firstly the port , in this case 0x378
which is the address of the printer
port on my PC and then the value to
send to the port , which in this case
is either 0 or 1 which switches the
LED on and off . We also use the_sleep()
function for a delay so you can actually
see the LED going on and off . The
1000 is the amount of milliseconds
to delay for .
This code is for Windows 95 , 98
. This will not work on Windows 2000
, NT or XP.
Download
ledflashvisc++.txt
|