C++ DevKit
C++ set of OOP library
Loading...
Searching...
No Matches
rtos_dht11.h
Go to the documentation of this file.
1
11#pragma once
12#include "hardware/gpio.h"
13
14#include "FreeRTOS.h"
15#include "queue.h"
16#include "task.h"
17
18
24{
26 bool is_valid;
28 float humidity;
30 float temp_celsius;
31} ;
32
33
39{
40private:
42 uint gpio_in;
43
45 QueueHandle_t dht_reading_queue;
46
47public:
48
50 void read_from_dht();
51
55 rtos_DHT11(uint gpio_in, QueueHandle_t dht_reading_ouput_queue);
56};
void read_from_dht()
the function called by a RTOS periodic task
Definition rtos_dht11.cpp:10
uint gpio_in
the GPIO connected to DHT11
Definition rtos_dht11.h:42
rtos_DHT11(uint gpio_in, QueueHandle_t dht_reading_ouput_queue)
the constructor for rtos_DHT11 object
Definition rtos_dht11.cpp:89
QueueHandle_t dht_reading_queue
the output queue that receives readings
Definition rtos_dht11.h:45
the sensor result is given according to this structure:
Definition dht11.h:22
float humidity
the converted values in % of relative humidity
Definition dht11.h:26
float temp_celsius
the converted value in °Celsius
Definition dht11.h:28
bool is_valid
a flag that indicates the reading from DHT11 is valid
Definition dht11.h:24