Toggle navigation
Documentation
The friendly Operating System for the Internet of Things
mq3.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2014 Freie Universität Berlin
3
*
4
* This file is subject to the terms and conditions of the GNU Lesser General
5
* Public License v2.1. See the file LICENSE in the top level directory for more
6
* details.
7
*/
8
21
#ifndef MQ3_H
22
#define MQ3_H
23
24
#include "
periph/adc.h
"
25
26
#ifdef __cplusplus
27
extern
"C"
{
28
#endif
29
33
#define MQ3_MAX_RAW_VALUE (1023U)
34
38
typedef
struct
{
39
adc_t
adc_line
;
40
}
mq3_t
;
41
56
int
mq3_init
(
mq3_t
*dev,
adc_t
adc_line);
57
65
int
mq3_read_raw
(
const
mq3_t
*dev);
66
74
int
mq3_read
(
const
mq3_t
*dev);
75
76
#ifdef __cplusplus
77
}
78
#endif
79
80
#endif
/* MQ3_H */
81
mq3_read
int mq3_read(const mq3_t *dev)
Read the scaled sensor value of PPM of alcohol.
adc_t
unsigned int adc_t
Define default ADC type identifier.
Definition:
adc.h:72
adc.h
Low-level ADC peripheral driver interface definitions.
mq3_t
device descriptor for a MQ-3 sensor
Definition:
mq3.h:38
mq3_init
int mq3_init(mq3_t *dev, adc_t adc_line)
Initialize a MQ-3 alcohol sensor.
mq3_read_raw
int mq3_read_raw(const mq3_t *dev)
Read the RAW sensor value, can be between 0 and MQ3_MAX_RAW_VALUE.
mq3_t::adc_line
adc_t adc_line
the used ADC line
Definition:
mq3.h:39
Generated on Tue Nov 24 2020 19:46:51 by
1.8.17