I'm trying to add in my calibration equation to the example Bridge program code, and am running into some issues.
One, I'm not sure I know where the variable 'lf' comes from. I've figured out that 'd' is the port on the bridge (0-3), and the only thing that 'lf' makes sense as is the voltage output. But it isn't defined anywhere, and if I try and use it in my equation it is underlined in red and hover-over says "identifier 'lf' is undefined"... so how is it using it in the printf?
Maybe I just don't know how the handles are supposed to work...
Any input is super appreciated!
Thanks!
Code: Select all
#define FREQS_SIZE 20
double bridges[FREQS_SIZE] = {0};
int CCONV data(CPhidgetBridgeHandle phid, void *userPtr, int index, double val)
{
CPhidgetBridgeHandle bridge = (CPhidgetBridgeHandle)phid;
double f, x, ms;
int i;
x = -147.2022*f - 2.1602;
printf("Load Reading (%d) %lf,\n",index,val);
/*if(val < 0)
printf("Data Event (%d) - -0x%06x\n",index,(int)-val);
else
printf("Data Event (%d) - +0x%06x\n",index,(int)val);*/
return 0;
}