digital
New Member
I want to create a program to count the number of times the d0 pin of the parallel port goes from high to low and have this code so far. I tried sending +6V in pulses to d0 and its not counting, please help me out.
#include <stdio.h>
#include <conio.h>
#include <dos.h>
#define PORT 0x378
void main()
{
unsigned int data=0;
outport(PORT, 0);
clrscr();
while(!kbhit());
{
data=inportb(PORT)+data;
}
printf("\n count = %d", data);
sleep(3);
}
#include <stdio.h>
#include <conio.h>
#include <dos.h>
#define PORT 0x378
void main()
{
unsigned int data=0;
outport(PORT, 0);
clrscr();
while(!kbhit());
{
data=inportb(PORT)+data;
}
printf("\n count = %d", data);
sleep(3);
}