parallel port programming simple problem

F

Flash Gordon

Chris said:
I think "are" is a negatypo for "aren't".

I think not because it was followed by the word not, so pete just didn't
use the contraction of "are not".
 
C

Chris Dollin

Flash said:
I think not because it was followed by the word not, so pete just didn't
use the contraction of "are not".

Not in /pete's/ posting, in /Default User's/.

But I should have been less ambiguous.
 
D

Default User

Chris said:
I think "are" is a negatypo for "aren't".

Ow. Yes, of course, as the rest of the text should have made plain.

I hate when that happens.



Brian
 
N

Neil

Sjouke said:
Neil said:
Marco said:
Could anyone please tell me why the program has the following error? I
copy the program from http://www.beyondlogic.org/parlcd/parlcd.htm


/////////////////////////////////////////////////////////////////////
#include <dos.h>
#include <string.h>
#include <stdio.h>

#define PORTADDRESS 0x378 /* Enter Your Port Address Here */

#define DATA PORTADDRESS+0
#define STATUS PORTADDRESS+1
#define CONTROL PORTADDRESS+2

void main(void)
{
char string[] = {"Testing 1,2,3 "
"It' Works ! "};
char init[10];
int count;
int len;
init[0] = 0x0F; /* Init Display */
init[1] = 0x01; /* Clear Display */
init[2] = 0x38; /* Dual Line / 8 Bits */

outportb(CONTROL, inportb(CONTROL) & 0xDF); /* Reset Control Port -
Make sure Forward Direction */

outportb(CONTROL, inportb(CONTROL) | 0x08); /* Set Select Printer
(Register Select) */

for (count = 0; count <= 2; count++)
{
outportb(DATA, init[count]);
outportb(CONTROL,inportb(CONTROL) | 0x01); /* Set Strobe (Enable)*/
delay(20); /* Larger Delay for INIT
*/
outportb(CONTROL,inportb(CONTROL) & 0xFE); /* Reset Strobe
(Enable)*/
delay(20); /* Larger Delay for INIT
*/
}

outportb(CONTROL, inportb(CONTROL) & 0xF7); /* Reset Select Printer
(Register Select) */

len = strlen(string);

for (count = 0; count < len; count++)
{
outportb(DATA, string[count]);
outportb(CONTROL,inportb(CONTROL) | 0x01); /* Set Strobe */
delay(2);
outportb(CONTROL,inportb(CONTROL) & 0xFE); /* Reset Strobe */
delay(2);
}
}
////////////////////////////////////////////////////////////////////////////////



--------------------Configuration: Text1 - Win32
Debug--------------------
Compiling...
Text1.c
C:\Program Files\Microsoft Visual Studio\Text1.c(22) : error C2065:
'outportb' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\Text1.c(22) : error C2065:
'inportb' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\Text1.c(30) : error C2065:
'delay' : undeclared identifier


Beside the programming issues posted, you have a worse problem.
You have MS-DOS code. Windows, NT, 2000, & XP will not let a user app
write to hardware. The code can not be fixed to do what you want.
You need to find one of the Parallel port drivers available on the net.
Yes it can,google for userport.zip
Sometimes computers are used to control
hardware :)
Outportb and inportb might be outp and inp.

Like I said userport.zip is a "a simple kernel mode driver for Windows
NT/2000/XP"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top