示例#1
0
//int main ( int argc, char *argv[] )
int read_prof ( char *name, int subint, double *profile, int nphase, int npol, int nchan)
{  
	double value[nphase*npol*nchan];
	double scl[npol*nchan];
	double offs[npol*nchan];

	read_value (name, subint, value, nphase, nchan, npol);
	read_offs (name, subint, offs, nchan, npol);
	read_scl (name, subint, scl, nchan, npol);

	int i,j,h;
    for (i = 0; i < npol; i++)                             // print the results
    //for (i = 0; i < nchan; i++)                             // print the results
	{
		for (h = 0; h < nchan; h++)                             // print the results
		//for (h = 0; h < npol; h++)                             // print the results
		{
			for (j = 0; j < nphase; j++)                             // print the results
			{
				//profile[i*nchan*nphase+h*nphase+j] = value[i*nchan*nphase+h*nphase+j];
				profile[i*nchan*nphase+h*nphase+j] = value[i*nchan*nphase+h*nphase+j]*scl[i*nchan+h] + offs[i*nchan+h];
				//profile[i*npol*nphase+h*nphase+j] = value[i*npol*nphase+h*nphase+j]*scl[i*npol+h] + offs[i*npol+h];
				//profile[i*nphase+j] = value[i*nphase+j];
				//printf("%d %lf \n", i, profile[i]);
			}
		}
	}

    return 0;
}
示例#2
0
文件: i2c_test.c 项目: gitpan/i2c
int main(void) {

 int test;
 unsigned char byte;
// PCF_ADRESS = 0;	// Adresse des PCF'S 
 
 printf("*** i²c-LCD Test (c) Ingo Gerlach 10/2000 *** \n");
 COM  = 0; 			// Vorbelegung Ser - Port, 0 Automatisch suchen
 set_port_delay(15);		// Portdelay 0-255 
 test = init_iic(COM);		// Init ii2c 
 printf("Suche i2c-Interface...");
 if (test) 
 {
  printf(" gefunden an Port 0x%03xh! \n",test);
 } else {
    printf("Interface nicht gefunden.\n");
    exit (0);
  }
/*
 set_strobe(1);			// Für den Seriellen Port nur dummy
 io_disable(0);
*/
 sda_high();
 scl_high();
 printf("read_sda %d \n",read_sda());
 printf("read_scl %d \n",read_scl());
 iic_start();
 byte =getchar();
 iic_stop();
 sda_low();
 scl_low();
 printf("read_sda %d \n",read_sda());
printf("read_scl %d \n",read_scl());    
lcd_backlight(0); 
byte = getchar();
 printf("deinit %d\n",deinit_iic()); 
 return 0;
}