/***********************************************
enout.c      For BL1200/Little PLC
	Repetitively enables and disables one of
	BL1200/Little PLC's eight output channels.
************************************************/
char hv_datum;
int i;
main()
{
  hv_enb();   /* enable high-voltage driver */
  while (1)
  {
    hv_datum = '\x00';   /* hex 00 == all OFF */
    hv_wr(hv_datum);  /* write byte to driver */
    for (i=0; i<10000; ++i) hitwd();  /* short pause */
  
    hv_datum = '\x04';  /* hex 04: port O6 ON */
                        /* high voltage drivers are backwardly, i.e.
                           bit 0 for O8 
                           bit 7 for 01 */

    hv_wr(hv_datum);  /* write byte to driver */
    for (i=0; i<30000; ++i) hitwd(); /* longer pause */
  }
}
