Skip to content

Commit 9611395

Browse files
committed
Switch to use noInterrupts and interrupts function. make read() public. This resolves pull #15.
1 parent ce05c35 commit 9611395

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

DHT.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ boolean DHT::read(void) {
119119
pinMode(_pin, OUTPUT);
120120
digitalWrite(_pin, LOW);
121121
delay(20);
122-
cli();
122+
noInterrupts();
123123
digitalWrite(_pin, HIGH);
124124
delayMicroseconds(40);
125125
pinMode(_pin, INPUT);
@@ -149,7 +149,7 @@ boolean DHT::read(void) {
149149

150150
}
151151

152-
sei();
152+
interrupts();
153153

154154
/*
155155
Serial.println(j, DEC);

DHT.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class DHT {
2424
private:
2525
uint8_t data[6];
2626
uint8_t _pin, _type, _count;
27-
boolean read(void);
2827
unsigned long _lastreadtime;
2928
boolean firstreading;
3029

@@ -35,6 +34,7 @@ class DHT {
3534
float convertCtoF(float);
3635
float computeHeatIndex(float tempFahrenheit, float percentHumidity);
3736
float readHumidity(void);
37+
boolean read(void);
3838

3939
};
4040
#endif

0 commit comments

Comments
 (0)