|
|
|
@ -25,11 +25,8 @@
|
|
|
|
|
#include "periph_conf.h" |
|
|
|
|
#include "periph/adc.h" |
|
|
|
|
|
|
|
|
|
#ifndef MQ3_ADC |
|
|
|
|
#error "MQ3_ADC is not specified" |
|
|
|
|
#endif |
|
|
|
|
#ifndef MQ3_CHAN |
|
|
|
|
#error "MQ3_CHAN is not specified" |
|
|
|
|
#ifndef MQ3_ADC_LINE |
|
|
|
|
#error "MQ3_ADC_LINE is not specified" |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
int main(void) |
|
|
|
@ -38,8 +35,8 @@ int main(void)
|
|
|
|
|
int res; |
|
|
|
|
|
|
|
|
|
puts("MQ-3 alcohol sensor test application\n"); |
|
|
|
|
printf("Initializing MQ-3 sensor at ADC_%i, channel %i... ", MQ3_ADC, MQ3_CHAN); |
|
|
|
|
res = mq3_init(&dev, MQ3_ADC, MQ3_CHAN); |
|
|
|
|
printf("Initializing MQ-3 sensor at ADC_LINE(%i)... ", (int)MQ3_ADC_LINE); |
|
|
|
|
res = mq3_init(&dev, MQ3_ADC_LINE); |
|
|
|
|
if (res == 0) { |
|
|
|
|
puts("[ok]\n"); |
|
|
|
|
} |
|
|
|
|