// Following code sends numeric character to LED
//Serial port handler, use COM1
HANDLE hComm = CreateFile(_T("COM1:"),
GENERIC_READ | GENERIC_WRITE,
0, NULL, OPEN_EXISTING, 0, NULL );
//Serial port setting
DCB commParam;
INT portNo = 1;
INT baud = 9600;
INT parity = NOPARITY;
INT databits = 8;
INT stopbits = 0;
//Display number "0123456789"
WriteFile (hComm,
"0123456789",
sizeof("0123456789"),
&dwNumBytesWritten,
NULL);
//output to LED
WriteFile (hComm,
end,
1,
&dwNumBytesWritten,
NULL);
//Close serial port
CloseHandle(hComm);
// Following code sends alpha character to LED
//Serial port handler, use COM1
HANDLE hComm = CreateFile(_T("COM1:"),
GENERIC_READ | GENERIC_WRITE,
0, NULL, OPEN_EXISTING, 0, NULL );
//Serial port setting
DCB commParam;
INT portNo = 1;
INT baud = 9600;
INT parity = NOPARITY;
INT databits = 8;
INT stopbits = 0;