User Tools

Site Tools


arduino_lib_dp1wds18xxxtermo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
arduino_lib_dp1wds18xxxtermo [2012/02/28 01:25]
admin created
arduino_lib_dp1wds18xxxtermo [2016/09/01 14:17] (current)
Line 1: Line 1:
 Documentation **[[arduino_code|Arduino base program code]]** Documentation **[[arduino_code|Arduino base program code]]**
-====== ​DpI2CLEDStatus ​library ======+====== ​Dp1WDS18xxxTermo ​library ======
 ===== Description ===== ===== Description =====
-DpI2CLEDStatus ​Arduino library provide function for using +Dp1WDS18xxxTermo ​Arduino library provide function for gething temperature 
-signaling LED on daince.nrt Status LED board with PCF8574A.+data form 1-Wire Maxim IC DS18x20 and DS1822 sensors. 
 + 
 +No parasit power units on bus are supported!!! ​. 
 + 
 +Some parts of code are used from  
 +http://​milesburton.com/​Dallas_Temperature_Control_Library
  
 Source code is provided as is, without any warranty. Source code is provided as is, without any warranty.
  
-Distributed ​under CC BY v 3.0+Distributetd ​under CC BY v 3.0
 ==== Functions ==== ==== Functions ====
 <​code>​ <​code>​
-// On inicialization ​define ​pin position for LEDs +// Model IDs 
-DpI2CLEDStatus(byte Addrbyte pR1=1, byte pG1=0, byte pB1=2, byte pL1=3, byte pR2=5, byte pG2=4, byte pB2=6byte pL2=7);+// #define ​DS1820MODEL 0x10  –55°C to +125°C in 0.5°C increments 
 +#define DS18S20MODEL 0x10 // -55°C to +125°C ±0.5°C Accuracy from -10°C to +85°C 9-Bit Resolution 
 +#define DS18B20MODEL 0x28 // -55°C to +125°C ±0.5°C Accuracy from -10°C to +85°Cresolution is User Selectable from 9 to 12 Bits 
 +#define DS1822MODEL ​ 0x22 // -55°C to +125°C ±2.0°C accuracy from -10°C to +85°Cresolution is user-selectable from 9 to 12 bits
  
-// Set all LEDs off +// Device resolution 
-void setAllOff();​+#define TEMP_9_BIT ​ 0x1F //  9 bit 
 +#define TEMP_10_BIT 0x3F // 10 bit 
 +#define TEMP_11_BIT 0x5F // 11 bit 
 +#define TEMP_12_BIT 0x7F // 12 bit
  
-// Set RGB LED  +// type deffinition to accomaodate ​1-Wire address 
-// R 1 Red On / 0 Red off +typedef ​byte DeviceAddress[8];
-// G - 1 Green On / 0 Green Off +
-// B - 1 Blue On / 0 Blue Off +
-void setRGBLED1(byte R, byte G, byte B);+
  
-// Set RGB LED 2  +// type deffinition to accomodate data from one 1-Wire termo sensor 
-// R - 1 Red On 0 Red off +typedef struct { 
-// G - 1 Green On 0 Green Off +  // device address 
-// B - 1 Blue On 0 Blue Off +  DeviceAddress dAddr; 
-void setRGBLED2(byte R, byte G, byte B);+ 
 +  ​// actual temperature in C 
 +  float dTemperature;​ 
 +  ​ 
 +  // minimal/low alarm temperature 
 +  float dMinAlarm;​ 
 +   
 +  ​// maximal/high alarm temperature 
 +  float dMaxAlarm;​ 
 +   
 +  // sensor resolution - raw byte 
 +  ​byte dTempReso;​ 
 +} SensorInfo;​ 
 + 
 + 
 + 
 +// initiate class of termo sensors 
 +// _oneWire pointer to Dp1WBasic class 
 +Dp1WDS18xxxTermo(Dp1WBasic*);
     ​     ​
-// Set LED +// read data from all temperature sensors on 1-Wire bus and return 
-// Status ​1 On 0 Off +// number of found sensors 
-void setLED1(byte Status);+// seIn array with data 
 +// maxNo - maximal number of sensors in seIn 
 +// serachType - NORMAL_SEARCH | ALARM_SEARCH 
 +//              NORMAL_SEARCH ​(default) - read all sensors 
 +//              ALARM_SEARCH - read only sensor with alarm 
 +byte readTemperature(SensorInfo seIn[], byte maxNo, ​byte searchType = NORMAL_SEARCH);
     ​     ​
-// Set LED 2 +// set 1-Wire termosensor data, and returns true if device was founded or false  
-// Status ​- 1 On / 0 Off +// in other case  
-void setLED2(byte Status);+// deviceAddres ​address of 1-Wire termo sensor 
 +// loTemp - minimal/low alarm temperature (default 70 C) in C 
 +// hiTemp - maximal/​high alarm temperature (default 75 C) in C  
 +// resTemp - TEMP_9_BIT ​ (0.5 C) 
 +//           ​TEMP_10_BIT ​(0.25 C) 
 +//           ​TEMP_11_BIT (0.125 C) 
 +//           ​TEMP_12_BIT (0.0625 C) default ​    
 +boolean setSensorData(DeviceAddress deviceAddress,​ int loTemp = 70, int hiTemp = 75, byte resTemp = TEMP_12_BIT); 
 +     
 +// returns true if address is valid or false in other case 
 +// deviceAddress - address of 1-Wire termo sensor 
 +boolean validAddress(uint8_t* deviceAddress);​ 
 </​code>​ </​code>​
  
Line 44: Line 87:
 ===== Version ===== ===== Version =====
 ==== Actual ==== ==== Actual ====
-  * **{{:​source_code:​arduino:​library:​dpi2cledstatus:dpi2cledstatus-1.0.0.tar.gz|dpi2cledstatus-1.0.0.tar.gz}}** +  * **{{:​source_code:​arduino:​library:​dp1wds18xxxtermo:dp1wds18xxxtermo-1.0.0.tar.gz|dp1wds18xxxtermo-1.0.0.tar.gz}}** 
-  * **{{:​source_code:​arduino:​library:​dpi2cledstatus:dpi2cledstatus-1.0.0.zip|dpi2cledstatus-1.0.0.zip}}**+  * **{{:​source_code:​arduino:​library:​dp1wds18xxxtermo:dp1wds18xxxtermo-1.0.0.zip|dp1wds18xxxtermo-1.0.0.zip}}**
 ==== History ==== ==== History ====
 === V 1.0.0 , 10.02.2012 === === V 1.0.0 , 10.02.2012 ===
-  * **{{:​source_code:​arduino:​library:​dpi2cledstatus:dpi2cledstatus-1.0.0.tar.gz|dpi2cledstatus-1.0.0.tar.gz}}** +  * **{{:​source_code:​arduino:​library:​dp1wds18xxxtermo:dp1wds18xxxtermo-1.0.0.tar.gz|dp1wds18xxxtermo-1.0.0.tar.gz}}** 
-  * **{{:​source_code:​arduino:​library:​dpi2cledstatus:dpi2cledstatus-1.0.0.zip|dpi2cledstatus-1.0.0.zip}}**+  * **{{:​source_code:​arduino:​library:​dp1wds18xxxtermo:dp1wds18xxxtermo-1.0.0.zip|dp1wds18xxxtermo-1.0.0.zip}}**
arduino_lib_dp1wds18xxxtermo.txt · Last modified: 2016/09/01 14:17 (external edit)