// experi9c.c

#include <dos.h>
#include <stdio.h>
#include <bios.h>

// defines OC structure
#include "outcont.h" 

// include header with constants
#include "constant.h"

// include header with external prototypes
#include "extern.h"

void main(void)
{
  int x;
  double dc,oldfreq,newfreq;

  oldfreq = 1193180.0/65536.0;

  set_up_new_timer(100.0);

  newfreq = get_frequency();

  printf("old frequency = %f new frequency = %fHz\n"
  ,oldfreq,newfreq);

  x = (int)InitializeAnalog();

  printf("init ana = %X\n",x);

  x = TurnOnAnalog(0);
  printf("TurnOnAnalog(0); = %d\n",x);
  while(!kbhit())
  {
    x = GetChannelValue(0);
    printf("%4d",x);
  }

  // be sure to restore the timer!
  restore_old_timer();
}

// end experi9c.c

