Added PM10 GP2Y1010AU0F sensor driver and demo test

This commit is contained in:
Toni Lozano 2016-01-22 12:15:33 +01:00
parent 4907842821
commit 42e1beb931
6 changed files with 71 additions and 86 deletions

View file

@ -45,7 +45,6 @@
#include "adc-sensors.h"
#include "adc-zoul.h"
#include "zoul-sensors.h"
#include <stdio.h>
#include <stdint.h>
/*---------------------------------------------------------------------------*/
@ -108,6 +107,7 @@ convert_to_value(uint8_t index)
value /= 100000;
return (uint16_t)value;
/* VDD+5 sensors */
case ANALOG_VAC_SENSOR:
/* Linear sensor from 0 to 5 V; 0.0088 resolution*/
value *= 88;
@ -116,13 +116,10 @@ convert_to_value(uint8_t index)
case ANALOG_AAC_SENSOR:
/* Linear sensor from 0 to 5 V;*/
value *= 1.2;
return (uint16_t)value;
case ANALOG_PM10_SENSOR:
/* PM10 sensor from 0 to 5 V; 0.0088 resolution*/
value *= 88;
value /= 10000;
/* PM10 sensor from 0 to 3.9 V;*/
return (uint16_t)value;
default:
@ -205,6 +202,7 @@ configure(int type, int value)
sensors.sensor[sensors.sensors_num].vdd3 = 1;
break;
/*V+5 sensors*/
case ANALOG_VAC_SENSOR:
case ANALOG_AAC_SENSOR:
case ANALOG_PM10_SENSOR: