inital commit working

This commit is contained in:
IMback
2018-11-26 22:30:39 +01:00
commit 63ff73a066
13 changed files with 644 additions and 0 deletions

23
dht11.h Normal file
View File

@ -0,0 +1,23 @@
#pragma once
#include <stdint.h>
#include<util/delay.h>
#include "writepin.h"
class Dht11
{
static constexpr uint16_t LOOP_TIMEOUT_COUNT = (10000.0 / 16000000.0)*F_CPU;
static constexpr uint8_t LOOP_TIMEOUT_SMALL_COUNT = (100.0 / 16000000.0)*F_CPU;
static constexpr uint8_t BIT_COUNT = 6;//(8.0 / 16000000.0)*F_CPU;
static constexpr bool DHT22 = true;
volatile unsigned char * const _port;
volatile unsigned char * const _port_ctl;
volatile unsigned char * const _inPort;
const unsigned char _pin;
public:
Dht11(volatile unsigned char *port, volatile unsigned char *inPort, volatile unsigned char *port_ctl, const unsigned char pin);
uint8_t read();
int16_t humidity = 0;
uint16_t temperature = 0;
};