Subject:
|
Parellel port control
|
Newsgroups:
|
lugnet.robotics.handyboard
|
Date:
|
Sun, 19 Jul 1998 17:07:12 GMT
|
Original-From:
|
adekolaf@is2.dal&NoSpam&.ca
|
Viewed:
|
1180 times
|
| |
| |
Has anybody tried using the "delay function, outportb function and
inportb function" that comes with Borland C++ 5.01. I am trying to
control a set of LEDs conncted to my printer port using a C++
program. My program woudn't compile. The error is that delay,
outportb and inportb functions are not define. A segment of my
program is as follows:
#include <dos.h>
#include <stdio.h>
#define BASE 0x0378 //base address of LPT1 for my computer
#define BASE_S BASE + 1
#define BASE_C BASE + 2
main( )
{
int data_in;
int count = 8;
do
{
outportb(DATA, 0x00); //turn eight LEDs on
delay(1000);
outportb(DATA, 0xff); //turn LEDs off
data_in = inportb((STATUS)^0x80)); //read in a byte.
printf("%x\n", data_in);
count = count - 1
}while(count !=0);
}
I would really appreciate if someone know what is wrong. I check the
dos.h files and it seems to be fine
|
|
1 Message in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|