Hello,I am doing a project in which i need to send and receive data from a microcontroller.I was trying to do this in DEV CPP IDE 4.9.9.2 but couldn't succeed till now.The following is the code i tried compiling.
The code:
#include <bios.h>
#include <conio.h>
#define COM1 0
#define DATA_READY 0x100
#define TRUE 1
#define FALSE 0
#define SETTINGS ( _COM_9600 | _COM_CHR8 | _COM_NOPARITY | _COM_STOP1)
int main(void)
{
int in, out, status, DONE = FALSE;
bioscom(0, SETTINGS, COM1);
cprintf("... BIOSCOM [ESC] to exit ...\n");
while (!DONE)
{
status = bioscom(3, 0, COM1);
if (status & DATA_READY)
if ((out = bioscom(2, 0, COM1) & 0x7F) != 0)
putch(out);
if (kbhit())
{
if ((in = getch()) == '\x1B')
DONE = TRUE;
bioscom(1, in, COM1);
}
}
return 0;
}
Previously i got an error saying that bios.h couldn't be found .Then I added bios.h from a TC's include directory.Now it got compiled but when I tried running it ,I got the following errors.
C:/Dev-Cpp/include/bios.h:21: error: variable or field `far' declared void
C:/Dev-Cpp/include/bios.h:21: warning: no semicolon at end of struct or union
C:/Dev-Cpp/include/bios.h:21: error: syntax error before '*' token
Can any one tell me how to solve this.Also can any one give me some sample code or resource to read on serial communication in C using DEV CPP IDE 4.9.9.2