Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding #ifndef DHT_H to header file #4

Merged
merged 1 commit into from Aug 27, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
75 changes: 39 additions & 36 deletions DHT.h
@@ -1,36 +1,39 @@
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif

/* DHT library

MIT license
written by Adafruit Industries
*/

// how many timing transitions we need to keep track of. 2 * number bits + extra
#define MAXTIMINGS 85

#define DHT11 11
#define DHT22 22
#define DHT21 21
#define AM2301 21

class DHT {
private:
uint8_t data[6];
uint8_t _pin, _type;
boolean read(void);
unsigned long _lastreadtime;
boolean firstreading;

public:
DHT(uint8_t pin, uint8_t type);
void begin(void);
float readTemperature(bool S=false);
float convertCtoF(float);
float readHumidity(void);

};
#ifndef DHT_H
#define DHT_H
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif

/* DHT library

MIT license
written by Adafruit Industries
*/

// how many timing transitions we need to keep track of. 2 * number bits + extra
#define MAXTIMINGS 85

#define DHT11 11
#define DHT22 22
#define DHT21 21
#define AM2301 21

class DHT {
private:
uint8_t data[6];
uint8_t _pin, _type;
boolean read(void);
unsigned long _lastreadtime;
boolean firstreading;

public:
DHT(uint8_t pin, uint8_t type);
void begin(void);
float readTemperature(bool S=false);
float convertCtoF(float);
float readHumidity(void);

};
#endif