tests: driver_isl29125: vtimer -> xtimer
This commit is contained in:
parent
e4a239b78a
commit
ef01db6d69
@ -4,7 +4,7 @@ include ../Makefile.tests_common
|
|||||||
FEATURES_REQUIRED = periph_i2c
|
FEATURES_REQUIRED = periph_i2c
|
||||||
|
|
||||||
USEMODULE += isl29125
|
USEMODULE += isl29125
|
||||||
USEMODULE += vtimer
|
USEMODULE += xtimer
|
||||||
|
|
||||||
ifneq (,$(TEST_ISL29125_I2C))
|
ifneq (,$(TEST_ISL29125_I2C))
|
||||||
CFLAGS += -DTEST_ISL29125_I2C=$(TEST_ISL29125_I2C)
|
CFLAGS += -DTEST_ISL29125_I2C=$(TEST_ISL29125_I2C)
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "vtimer.h"
|
#include "xtimer.h"
|
||||||
#include "isl29125.h"
|
#include "isl29125.h"
|
||||||
|
|
||||||
#define SLEEP (250 * 1000U)
|
#define SLEEP (250 * 1000U)
|
||||||
@ -66,7 +66,7 @@ int main(void)
|
|||||||
for (int i = 0; i < sizeof(modes); i++) {
|
for (int i = 0; i < sizeof(modes); i++) {
|
||||||
printf("Setting mode %s\n", mode_names[i]);
|
printf("Setting mode %s\n", mode_names[i]);
|
||||||
isl29125_set_mode(&dev, modes[i]);
|
isl29125_set_mode(&dev, modes[i]);
|
||||||
vtimer_usleep(SLEEP);
|
xtimer_usleep(SLEEP);
|
||||||
isl29125_read_rgb_color(&dev, &data8bit);
|
isl29125_read_rgb_color(&dev, &data8bit);
|
||||||
printf("RGB value: (%3i / %3i / %3i) 8 bit\n",
|
printf("RGB value: (%3i / %3i / %3i) 8 bit\n",
|
||||||
data8bit.r, data8bit.g, data8bit.b);
|
data8bit.r, data8bit.g, data8bit.b);
|
||||||
@ -74,12 +74,12 @@ int main(void)
|
|||||||
|
|
||||||
puts("Resetting mode to RGB and reading continuously");
|
puts("Resetting mode to RGB and reading continuously");
|
||||||
isl29125_set_mode(&dev, ISL29125_MODE_RGB);
|
isl29125_set_mode(&dev, ISL29125_MODE_RGB);
|
||||||
vtimer_usleep(SLEEP);
|
xtimer_usleep(SLEEP);
|
||||||
while (1) {
|
while (1) {
|
||||||
isl29125_read_rgb_lux(&dev, &data);
|
isl29125_read_rgb_lux(&dev, &data);
|
||||||
printf("RGB value: (%5i / %5i / %5i) lux\n",
|
printf("RGB value: (%5i / %5i / %5i) lux\n",
|
||||||
(int)data.red, (int)data.green, (int)data.blue);
|
(int)data.red, (int)data.green, (int)data.blue);
|
||||||
vtimer_usleep(SLEEP);
|
xtimer_usleep(SLEEP);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user