Computer Chess Club Archives


Search

Terms

Messages

Subject: Novag Universal ChessBoard Programming

Author: Stuart Cracraft

Date: 22:08:51 03/27/98


I've been trying to write a GNU C program on an IBM-PC to send a chess
move to the Novag Universal Chess Board via COM port 1 without much luck
and wondering if anyone else has succeeded. The end result goal for
me would be to use the code to interface a non-commercial hobbyist
program (mine) to the UCB to make move entry easier when testing
and playing against my program.

The notation I'm told (http://www.pawn.demon.co.uk/UCBProt.htm)
is, for example, "Me2-e4" when sending a move to the board (without
the "-" when reading it back.)

Anyway, after using _bios_serialcom, to initialize the port to
9600, 8 data bits, no parity, 1 stop bit. I send the characters
one by one with the bios routine supported by the GNU C. The result
is no lights lit on the board (which is set to the middle-switch
position of "PC".)

Anyway, here's the code. And this doesn't even address the issues
of reading the COM1 port for a move made by someone on the UCB
or polling the port to see if i/o is available.

Wizards?

#include <bios.h>

main()
{
  register i;
  char buf[10];
  /* 9600 baud, no parity, one stop, 8 bits */
  _bios_serialcom(_COM_INIT, 0,
_COM_9600|_COM_NOPARITY|_COM_STOP1|_COM_CHR8);
  sprintf(buf,"Me2-e4\r\n");
  for(i=0; buf[i]; i++)
    _bios_serialcom(_COM_SEND, 0, buf[i]);
}



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.