{
if (!resource_sensor_s.opened) return;
- _I("Infrared Motion Sensor is finishing...");
+ _I("Illuminance Sensor is finishing...");
peripheral_i2c_close(resource_sensor_s.sensor_h);
resource_sensor_s.opened = 0;
}
resource_sensor_s.opened = 1;
}
- ret = peripheral_i2c_write_byte(resource_sensor_s.sensor_h, GY30_CONT_HIGH_RES_MODE);
+ buf[0] = GY30_CONT_HIGH_RES_MODE;
+ ret = peripheral_i2c_write(resource_sensor_s.sensor_h, buf, 1);
retv_if(ret < 0, -1);
ret = peripheral_i2c_read(resource_sensor_s.sensor_h, buf, 2);
*out_value = (buf[0] << 8 | buf[1]) / GY30_CONSTANT_NUM; // Just Sum High 8bit and Low 8bit
- _I("Infrared Motion Sensor Value : %d", *out_value);
+ _I("Illuminance Sensor Value : %d", *out_value);
return 0;
}