mirror of
				https://github.com/niesteszeck/idDHT11.git
				synced 2025-10-30 14:44:03 +03:00 
			
		
		
		
	v 0.1.1 Optimization by pylon
added a changelog
This commit is contained in:
		
							
								
								
									
										21
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								README.md
									
									
									
									
									
								
							| @@ -3,11 +3,22 @@ idDHT11 | |||||||
|  |  | ||||||
| Interrupt driven DHT11 library | Interrupt driven DHT11 library | ||||||
|  |  | ||||||
| VERSION:   0.1 | 	VERSION:   0.1.1 | ||||||
| PURPOSE: 	Interrupt driven Lib for DHT11 with Arduino. |  | ||||||
| 	 | 	 | ||||||
| LICENCE:	GPL v3 (http://www.gnu.org/licenses/gpl.html) | 	PURPOSE: 	Interrupt driven Lib for DHT11 with Arduino. | ||||||
|  |  | ||||||
| DATASHEET: http://www.micro4you.com/files/sensor/DHT11.pdf | 	LICENCE:	GPL v3 (http://www.gnu.org/licenses/gpl.html) | ||||||
|  |  | ||||||
| Based on DHT11 library: http://playground.arduino.cc/Main/DHT11Lib | 	DATASHEET: http://www.micro4you.com/files/sensor/DHT11.pdf | ||||||
|  | 		 | ||||||
|  | 	Based on DHT11 library: http://playground.arduino.cc/Main/DHT11Lib | ||||||
|  |  | ||||||
|  | 	Changelog: | ||||||
|  | 		 | ||||||
|  | 			v 0.1 | ||||||
|  | 			 | ||||||
|  | 				First version, added Functionality to DHT11 sensor | ||||||
|  | 			 | ||||||
|  | 			v 0.1.1 | ||||||
|  | 			 | ||||||
|  | 				Optimizacion on shift var (pylon from Arduino Forum) | ||||||
|   | |||||||
							
								
								
									
										11
									
								
								idDHT11.cpp
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								idDHT11.cpp
									
									
									
									
									
								
							| @@ -1,11 +1,17 @@ | |||||||
| /* | /* | ||||||
| 	FILE: 		idDHT11.cpp | 	FILE: 		idDHT11.cpp | ||||||
| 	VERSION: 	0.1 | 	VERSION: 	0.1.1 | ||||||
| 	PURPOSE: 	Interrupt driven Lib for DHT11 with Arduino. | 	PURPOSE: 	Interrupt driven Lib for DHT11 with Arduino. | ||||||
| 	LICENCE:	GPL v3 (http://www.gnu.org/licenses/gpl.html) | 	LICENCE:	GPL v3 (http://www.gnu.org/licenses/gpl.html) | ||||||
| 	DATASHEET: http://www.micro4you.com/files/sensor/DHT11.pdf | 	DATASHEET: http://www.micro4you.com/files/sensor/DHT11.pdf | ||||||
| 	 | 	 | ||||||
| 	Based on DHT11 library: http://playground.arduino.cc/Main/DHT11Lib | 	Based on DHT11 library: http://playground.arduino.cc/Main/DHT11Lib | ||||||
|  | 	 | ||||||
|  | 	Changelog: | ||||||
|  | 		v 0.1 | ||||||
|  | 			First version, added Functionality to DHT11 sensor | ||||||
|  | 		v 0.1.1 | ||||||
|  | 			Optimizacion on shift var (pylon from Arduino Forum) | ||||||
| */ | */ | ||||||
|  |  | ||||||
| #include "idDHT11.h" | #include "idDHT11.h" | ||||||
| @@ -91,8 +97,9 @@ void idDHT11::isrCallback() { | |||||||
| 				status = IDDHTLIB_ERROR_DELTA; | 				status = IDDHTLIB_ERROR_DELTA; | ||||||
| 				state = STOPPED; | 				state = STOPPED; | ||||||
| 			} else if(60<delta && delta<135) { //valid in timing | 			} else if(60<delta && delta<135) { //valid in timing | ||||||
|  | 				bits[idx] <<= 1; | ||||||
| 				if(delta>90) //is a one | 				if(delta>90) //is a one | ||||||
| 					bits[idx] |= (1 << cnt); | 					bits[idx] |= 1; | ||||||
| 				if (cnt == 0) {  // whe have fullfilled the byte, go to next | 				if (cnt == 0) {  // whe have fullfilled the byte, go to next | ||||||
| 						cnt = 7;    // restart at MSB | 						cnt = 7;    // restart at MSB | ||||||
| 						if(idx++ == 4) {      // go to next byte, if whe have got 5 bytes stop. | 						if(idx++ == 4) {      // go to next byte, if whe have got 5 bytes stop. | ||||||
|   | |||||||
							
								
								
									
										10
									
								
								idDHT11.h
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								idDHT11.h
									
									
									
									
									
								
							| @@ -1,11 +1,17 @@ | |||||||
| /* | /* | ||||||
| 	FILE: 		idDHT11.h | 	FILE: 		idDHT11.h | ||||||
| 	VERSION: 	0.1 | 	VERSION: 	0.1.1 | ||||||
| 	PURPOSE: 	Interrupt driven Lib for DHT11 with Arduino. | 	PURPOSE: 	Interrupt driven Lib for DHT11 with Arduino. | ||||||
| 	LICENCE:	GPL v3 (http://www.gnu.org/licenses/gpl.html) | 	LICENCE:	GPL v3 (http://www.gnu.org/licenses/gpl.html) | ||||||
| 	DATASHEET: http://www.micro4you.com/files/sensor/DHT11.pdf | 	DATASHEET: http://www.micro4you.com/files/sensor/DHT11.pdf | ||||||
| 	 | 	 | ||||||
| 	Based on DHT11 library: http://playground.arduino.cc/Main/DHT11Lib	 | 	Based on DHT11 library: http://playground.arduino.cc/Main/DHT11Lib	 | ||||||
|  |  | ||||||
|  | 	Changelog: | ||||||
|  | 		v 0.1 | ||||||
|  | 			First version, added Functionality to DHT11 sensor | ||||||
|  | 		v 0.1.1 | ||||||
|  | 			Optimizacion on shift var (pylon from Arduino Forum) | ||||||
| */ | */ | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -18,7 +24,7 @@ | |||||||
| #include <WProgram.h> | #include <WProgram.h> | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #define IDDHT11LIB_VERSION "0.1" | #define IDDHT11LIB_VERSION "0.1.1" | ||||||
|  |  | ||||||
| // state codes | // state codes | ||||||
| #define IDDHTLIB_OK				0 | #define IDDHTLIB_OK				0 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 niesteszeck
					niesteszeck