X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=server%2Fsensor.c;h=8e4773f1bd5c184b9233edb3d9d6719877575750;hb=0a476cadcd95219f49ad6f0ea9d404e8072e9f1d;hp=c3444bff861e289066f23cd795d507011d79258d;hpb=10a0d0813cab99327bcb7f7fcb0008c783cfc685;p=matches%2FMCTX3420.git diff --git a/server/sensor.c b/server/sensor.c index c3444bf..8e4773f 100644 --- a/server/sensor.c +++ b/server/sensor.c @@ -45,8 +45,8 @@ void Sensor_Init() Data_Init(&(g_sensors[i].data_file)); } - // Get the ADCs - //ADC_Export(); + // Get the required ADCs + ADC_Export(0); // GPIO1_28 used as a pulse for sampling //GPIO_Export(GPIO1_28); @@ -178,9 +178,10 @@ bool Sensor_Read(Sensor * s, DataPoint * d) case 2: { static bool set = false; - + int raw_adc = 0; //GPIO_Set(GPIO0_30, true); - d->value = (double)ADC_Read(ADC0); //ADC #0 on the Beaglebone + ADC_Read(ADC0, &raw_adc); + d->value = (double)raw_adc; //ADC #0 on the Beaglebone //Log(LOGDEBUG, "Got value %f from ADC0", d->value); //GPIO_Set(GPIO0_30, false); set = !set;