1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2026-01-01 01:41:18 +01:00

tests/driver_bh1750fvi: check return value

This commit is contained in:
Hauke Petersen 2016-11-17 22:58:19 +01:00
parent 40116c7c66
commit 31aeb3a09a

View File

@ -28,13 +28,18 @@
int main(void)
{
int res;
bh1750fvi_t dev;
uint32_t last = xtimer_now();
puts("BH1750FVI ambient light sensor test\n");
/* initialize the device */
bh1750fvi_init(&dev, (bh1750fvi_params_t *)(&bh1750fvi_params));
res = bh1750fvi_init(&dev, (bh1750fvi_params_t *)(&bh1750fvi_params));
if (res != BH1750FVI_OK) {
puts("error: unable to initialize sensor [I2C initialization error]");
return 1;
}
/* periodically sample the sensor */
while(1) {