Commit aa6e897f68568725f1fb996a14c47b1b31d7d1f4

Authored by Imanol-Mikel Barba Sabariego
1 parent 152f6c27

--no commit message

Project/applications/smartcities/sensors.c
1 1 #include "sensors.h"
2 2  
3   -sensor light_sensor = {LIGHT_ADDR, "Light sensor", "illumination", "lux",NULL};
4   -sensor ultrasound_sensor = {DISTANCE_ADDR, "Ultrasound sensor", "distance", "cm",NULL};
5   -sensor pressure_sensor = {PRESSURE_ADDR, "Pressure sensor", "pressure", "kPa",NULL};
  3 +sensor light_sensor = {LIGHT_ADDR, "Light sensor", "illumination", "lux",NULL};
  4 +sensor ultrasound_sensor = {DISTANCE_ADDR, "Ultrasound sensor", "distance", "cm",NULL};
  5 +sensor pressure_sensor = {PRESSURE_ADDR, "Pressure sensor", "pressure", "kPa",NULL};
  6 +sensor humidity_temp_sensor = {HUMIDITY_TEMP_ADDR, "Humidity and Temperature","ºC,RH",NULL};
6 7  
7 8 uint32_t get_light_data(void)
8 9 {
... ... @@ -21,7 +22,7 @@ uint16_t get_light_ch0(void)
21 22 I2C_start(I2C1,LIGHT_ADDR << 1, I2C_Direction_Transmitter);
22 23 I2C_write(I2C1, 0x0D);
23 24 I2C_stop(I2C1);
24   -
  25 +
25 26 I2C_start(I2C1, LIGHT_ADDR << 1, I2C_Direction_Receiver);
26 27 data = I2C_read_ack(I2C1);
27 28 data = data << 8;
... ...