#include #include #include #include #include "mirror.h" #include "tcs.h" double ra, dec; time_t tloc, oldtloc; struct tm *hst; main(int argc, char *argv[]) { int i; double pos; double altitude, azimuth; oldtloc = tloc = 0; get_tcspos(&ra,&dec); printf("%lf %lf\n",ra,dec); mropen("/dev/ttyS0"); /* mropen("/dev/ttyC0"); */ while(1) { get_tcsaltaz(&altitude, &azimuth); tloc = time(0); if (tloc-oldtloc > 60) { printf("\n"); oldtloc = tloc; } hst = localtime(&tloc); printf("%2d %02d %02d %2d %02d %02d ",hst->tm_year,hst->tm_mon,hst->tm_mday,hst->tm_hour,hst->tm_min,hst->tm_sec); printf("%6.3lf %7.3lf ",altitude,azimuth); for (i=0; i<5; i++) { pos = mrpos(i); printf("%8.3lf ",pos); } printf("\r"); fflush(stdout); } mrclose(); }