39 #include <px4_platform_common/time.h> 40 #include <px4_platform_common/px4_config.h> 41 #include <px4_platform_common/posix.h> 42 #include <px4_platform_common/log.h> 44 #include <sys/types.h> 61 PX4_ERR(
"ERROR: can't open ADC device");
65 for (
unsigned i = 0; i < 5; i++) {
69 ssize_t count =
px4_read(fd, data,
sizeof(data));
75 unsigned channels = count /
sizeof(data[0]);
77 for (
unsigned j = 0; j < channels; j++) {
78 printf(
"%d: %u ", data[j].am_channel, data[j].am_data);
85 printf(
"\t ADC test successful.\n");
#define PX4_MAX_ADC_CHANNELS
int test_adc(int argc, char *argv[])