int main( int argc, char *argv[] ) { FILE *fp; int i; progname = argv[0]; pout = popen(OUTFILT, "w"); if (argc > 1) for (i = 1; i < argc; i++) { fp = efopen(argv[i], "r"); plot4(fp); fclose(fp); } else plot4(stdin); pglob(PEOF, 0200, NULL); return(pclose(pout)); }
void scopePlot::add4(double *data, unsigned long len,QString curveName) { c4.resize(len); for (unsigned long i = 0; i < len; i++) { c4[i]=data[i]; } plot4(curveName); }
void Bucle_Principal() { int salida=0; int angulo = 0; int who_a_I_tmp = 0; //------------------------------------------------------------------------------------------// double accXangle = (atan2(get_ax(), -get_ay()) * RAD_TO_DEG ); double gyroXrate = (double) (get_gz() ) / 131.0; if (tipoFiltro==1){ angulo = (signed int) Complementary2(accXangle, gyroXrate,Tsample)-90; } else { angulo = (signed int) kalman(accXangle, gyroXrate,Tsample)-90; } if (act_motor==1){ salida = pid(setpoint, angulo,5, KP, KI, KD, 5000, -5000, 10000, -10000); SetPwm1(BIAS1 - salida); SetPwm2(BIAS2 + salida); who_a_I_tmp = get_who_I_AM(); if(who_a_I_tmp != 104) { Init_I2C(); reset(); } enviar_valor_NOCR("ax= ",get_ax()); enviar_valor_NOCR(" ay = ",get_ay()); enviar_valor_NOCR(" gz= ",get_gz()); enviar_valor(" who = ",get_who_I_AM()); } else { SetPwm1(0); SetPwm2(0); ErrorI=0; } plot4(accXangle-90,angulo,salida/10,setpoint); LED_ROJO=!LED_ROJO; }
int main(int argc, char *argv[]) { int i, digmax; int xleng0 = 400, yleng0 = 300, xoff0 = 200, yoff0 = 200; int xleng1 = 400, yleng1 = 300, xoff1 = 500, yoff1 = 500; /* Select either TK or DP driver and use a small window */ /* Using DP results in a crash at the end due to some odd cleanup problems */ /* The geometry strings MUST be in writable memory */ char geometry_master[] = "500x410+100+200"; char geometry_slave[] = "500x410+650+200"; char driver[80]; /* plplot initialization */ /* Parse and process command line arguments */ (void) plparseopts(&argc, argv, PL_PARSE_FULL); plgdev(driver); printf("Demo of multiple output streams via the %s driver.\n", driver); printf("Running with the second stream as slave to the first.\n"); printf("\n"); /* Set up first stream */ plsetopt("geometry", geometry_master); plsdev(driver); plssub(2, 2); plinit(); /* Start next stream */ plsstrm(1); /* Turn off pause to make this a slave (must follow master) */ plsetopt("geometry", geometry_slave); plspause(0); plsdev(driver); plinit(); /* Set up the data & plot */ /* Original case */ plsstrm(0); xscale = 6.; yscale = 1.; xoff = 0.; yoff = 0.; plot1(); /* Set up the data & plot */ xscale = 1.; yscale = 1.e+6; plot1(); /* Set up the data & plot */ xscale = 1.; yscale = 1.e-6; digmax = 2; plsyax(digmax, 0); plot1(); /* Set up the data & plot */ xscale = 1.; yscale = 0.0014; yoff = 0.0185; digmax = 5; plsyax(digmax, 0); plot1(); /* To slave */ /* The pleop() ensures the eop indicator gets lit. */ plsstrm(1); plot4(); pleop(); /* Back to master */ plsstrm(0); plot2(); plot3(); /* To slave */ plsstrm(1); plot5(); pleop(); /* Back to master to wait for user to advance */ plsstrm(0); pleop(); /* Call plend to finish off. */ plend(); exit(0); }