root@home BLCD]# gcc test5.c test5
gcc: test5: No such file or directory
test5.c:9:17: dos.h: No such file or directory
test5.c: In function `main':
test5.c:21: warning: return type of `main' is not `int'
[root@home BLCD]#
I added this "/* in the left hand corner of the first line but I have the
above error.
what is happened. dos.h is found in the linux box.
/* LCD Module Software */
/* 17th May 1997 */
/* Copyright 1997 Craig Peacock */
/* WWW - http://www.senet.com.au/~cpeacock */
/* Email - cp******@senet.com.au */
/* */
/* Register Select must be connected to Select Printer (PIN 17) */
/* Enable must be connected to Strobe (PIN1) */
/* DATA 0:7 Connected to DATA 0:7 */
#include <dos.h>
#include <string.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);
}
}