[last updated: 2025-05-12]
i2c on DigiSpark
i2c on rPi for GMC
SPI vs. i2c
i2c: minimum code
Programming Wire.h library commands:
-----
- i2C (Inter-Integrated Circuit) is a protocol for serial communication.
It is usually used between components in an embedded system (which already share power and ground lines).
In such a system, it only requires 2 signal lines
(if it is not being used in an "embedded" system, then at least the ground lines must be connected between master and slave):
- SCL = serial Clock (usu pin A5)
- SDA = serial Data (usu pin A4)
- SDA & SCL lines need pullup resistors,
however the Wire.h library enables the Arduino's internal pullups
when initializing with Wire.begin().
- Two or more nodes communicate according to:
- one master
(however there are ways to use more than one master - see details later)
- one or more slaves
- Range is probably 1 - 3 meters.
- researching this subject on the net reveals lots of different opinions:
- The answer apparently depends mostly on capacitance between the wires.
- There are reports of achieving 25m or even more.
- At some point I'll just get some longer wires and test it myself...
- Most common library is built-in Wire.h
- Programming Wire:
--------------------------------------
Projects:
------------------------------
Links:
.
.
.
eof