X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=server%2Fsensor.c;h=63e69d81e8522637d10749ae941c444ef5ee5b50;hb=6783694cfc5731afc561ea0e6737b6a982befa29;hp=98896e8b44aaac34002fefdd6eb88081b3a22921;hpb=d65175a25f5fcc0c63712e5c50adbb1a5ad1bafd;p=matches%2FMCTX3420.git diff --git a/server/sensor.c b/server/sensor.c index 98896e8..63e69d8 100644 --- a/server/sensor.c +++ b/server/sensor.c @@ -46,12 +46,12 @@ void Sensor_Init() } // Get the ADCs - ADC_Export(); + //ADC_Export(); // GPIO1_28 used as a pulse for sampling - GPIO_Export(GPIO1_28); + //GPIO_Export(GPIO1_28); // GPIO0_30 toggled during sampling - GPIO_Export(GPIO0_30); + //GPIO_Export(GPIO0_30); } /** @@ -175,16 +175,18 @@ bool Sensor_Read(Sensor * s, DataPoint * d) // Read value based on Sensor Id switch (s->id) { - case ANALOG_REALTEST: + case 2: { static bool set = false; - GPIO_Set(GPIO0_30, true); - d->value = 0;//(double)ADC_Read(ADC0); //ADC #0 on the Beaglebone + //GPIO_Set(GPIO0_30, true); + d->value = (double)ADC_Read(ADC0); //ADC #0 on the Beaglebone //Log(LOGDEBUG, "Got value %f from ADC0", d->value); - GPIO_Set(GPIO0_30, false); + //GPIO_Set(GPIO0_30, false); set = !set; - GPIO_Set(GPIO1_28, set); + //GPIO_Set(GPIO1_28, set); + + usleep(100000); break; }