Arduino Library – Dallas Temperature Control Library
Installatie van Arduino IDE libraries: Arduino info
Informatie (ENG):
This library supports the following devices :
- DS18B20
- DS18S20 – Please note there appears to be an issue with this series.
- DS1822
- DS1820
You will need a pull-up resistor of about 5 KOhm between the 1-Wire data line and your 5V power. If you are using the DS18B20, ground pins 1 and 3. The centre pin is the data line ‘1-wire’.
We have included a “REQUIRESNEW” and “REQUIRESALARMS” definition. If you want to slim down the code feel free to use either of these by including
1 2 |
#define REQUIRESNEW |
or
1 2 |
#define REQUIRESALARMS |
at the top of DallasTemperature.h
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
[1.0] First version [1.5.0 Test] Includes negative temperature support [2.0.0] Updated by Tim Newsome to include support for multiple ICs on the same OneWire [2.0.1] A slightly leaner version of 2.0.0 [2.5.0] James Whiddon has re-factored the core code to provide accurate timings, increased sensor resolution, detect parasite power (etc). [3.0.0] Another addition by James Whiddon. He has re-factored much of the original code and included a new example sketch. [3.0.0b] Includes a fix for the S series of devices by Nic Johns [3.1.0] Heavily re-factored version of 3.0.0b. Includes 4 new sketches and several additional functions to make sketches simple for new user who 'just want to get going' [3.2.0] Separated OneWire and DallasTemperature libraries so you only need to install one if you've already got OneWire installed (avoids those annoying conflicts). This includes full support for alarms and a supporting example. We have also included a couple of definitions should you want to remove the alarm functionality to save some memory [3.3.0] bool hasAlarm(void); This allows you to know if ANY device is reporting an alarm without having to scan each device on the bus. void setAlarmHandler(AlarmHandler *); You can define a function that will be executed when an alarm condition exists on a device. The function takes a device address as an argument. The handler is executed when processAlarms() is called. void processAlarms(void); Used in loop(). Performs an alarmSearch() and calls the appropriate AlarmHandler for any devices with alarms. AlarmHandler.pde example included. Core Updates: private float calculateTemperature(uint8_t*, uint8_t*); This was done so the hasAlarm(uint8_t*) function didn't have to read the scratchpad twice or include duplicate code for measuring the temperature. Change is invisible to the end user. Updated keywords.txt [3.4.0] Fixes: Fixed incorrect address array sizes in hasAlarm and processAlarms setResolution now only reads the scratchpad once setHighAlarmTemp and setLowAlarmTemp now read the scratchpad to ensure the scratchpad contains the data for the device address you're setting Changes: Changed DEVICE_DISCONNECTED value to -127 so it can be passed as a result in functions returning a char value getLowAlarmTemp and getHighAlarmTemp now return DEVICE_DISCONNECTED if the device is disconnected Added typedef uint8_t DeviceAddress[8] (hopefully to help prevent mistakes like were in hasAlarm and processAlarms) Added typedef uint8_t ScratchPad[9] Updated demo sketches to use DeviceAddress typedef [3.5.0] Guil Barros submitted two additional functions, GetTemperatureByIndex & GetTemperatureByAddress to make life a little easier [3.6.0] Device count is reset when you call the begin() method. This allows you to detect new ICs without resetting your MCU. Many thanks to two contributors for emailing me this fix! Great Work Peter Maag & Paolo Bosetti. [3.7.0] Rob Tillaart was kind enough to introduce a new revision to the library, asynchronous calls. When you request a temperature you can choose to manage the delay in your own code and continue processing other data. This code is still considered beta so if you spot any issues let me know. [3.7.1] Daniel Seither has cleaned up some of the example files for better legibility, thanks Daniel. [3.7.3] - Merge pull request #35 from milesburton/RobTillaart-master - Rob tillaart master [3.7.4] - Merge pull request #38 from RobTillaart/master - example to generate address array from connected devices [3.7.5] Update library.properties [3.7.6] Update library.properties |
Download @ milesburton.com
Download @ github.com
[#/arduino/libraries/dallas_temperature_control_library” ]