Dallas Semiconductor's 1-Wire Protocolhttp://playground.arduino.cc/Learning/OneWire - 1-Wire Protocol (This page still needs some more generalisation to 1-Wire, as some code is specific to 'using the DS1820' and a specifc LCD. It also needs a cleaning of the library paragraph that includes references to older versions of libraries.) Dallas Semiconductor (now Maxim) produces a family of devices that are controlled through a proprietary 1-wire protocol. There are no fees for programmers using the Dallas 1-Wire (trademark) drivers. On a 1-Wire network, which Dallas has dubbed a 'MicroLan' (trademark), a single 'master' device communicates with one or more 1-Wire 'slave' devices over a single data line, which can also be used to provide power to the slave devices. (Devices drawing power from the 1-wire bus are said to be operating in parasitic power mode.) http://sheepdogguides.com/arduino/asw1onew1.htm Tom Boyd's guide to 1-Wire may tell you more than you want to know... but it may also answer questions and inspire interest. The 1-wire temperature sensors have become particularly popular, because they're inexpensive and easy to use, providing calibrated digital temperature readings directly. They are more tolerant of long wires between sensor and Arduino. The sample code below demonstrates how to interface with a 1-wire device using Jim Studt's OneWire Arduino library, with the DS18S20 digital thermometer as an example. Many 1-Wire chips can operate in both parasitic and normal power modes. MicroLans can be accessed directly by an Arduino, using the mature Arduino OneWire library. Alternatively, they can be accessed through an interface which costs a little money, but reduces the workload inside the Arduino. The interface cost $8 in kit form at 2/2010. There is a guide to using it from an independent source.
Wire.h Library Download
I2C (Wire library)¶ Wire library currently supports master mode up to approximately 450KHz. Before using I2C, pins for SDA and SCL need to be set by calling Wire.begin(int sda, int scl), i.e. Wire.begin(0, 2) on ESP-01, else they default to pins 4(SDA) and 5(SCL). I2C (Wire library) Wire library currently supports master mode up to approximately 450KHz. Before using I2C, pins for SDA and SCL need to be set by calling Wire.begin(int sda, int scl), i.e. Wire.begin(0, 2) on ESP-01, else they default to pins 4(SDA) and 5(SCL). SPI library supports the entire Arduino SPI API including transactions.