Questions tagged [i2c]

Inter-Integrated Circuit (I²C) is a bus for low speed peripherals. Use this tag for questions regarding how to use I²C with an Arduino, or for problems with I²C and your Arduino.

Inter-Integrated Circuit (I²C) is a bus for low speed peripherals. It was invented by Philips, but many companies have created devices using the I²C protocol.

Use this tag for questions regarding how to use I²C with an Arduino, or for problems with I²C and your Arduino.

See the Wikipedia article for more info.

729 questions
12
votes
3 answers

How do I use I2C devices with Arduino?

I have a few useful I2C components, such as a 16-bit port expander (MCP23017), which I'd like to use in various projects. What do I need to do to make these work with Arduino? Will it work with any Arduino, or do I need a specific board or shield?
Peter Bloomfield
  • 10,842
  • 9
  • 46
  • 87
11
votes
2 answers

Cheap Wired Multipoint Mesh Network

I'm looking to make a 15 x 15 grid of load sensors and RGB LEDs for an interactive dance floor. Each node will be driven by an arduino and the entire floor will be managed by a RaspberryPi. I'm trying to figure out the best way to have the nodes…
Jeremy Gillick
  • 471
  • 1
  • 3
  • 8
10
votes
1 answer

How to design and debug a custom I2C master-slave system?

How to proceed, when in need of a custom I2C master-slave system? What are the design criteria to apply? What are the debugging tools one can use to troubleshoot problems?
Igor Stoppa
  • 2,125
  • 1
  • 12
  • 20
10
votes
1 answer

What does it mean in I2C, "NACK received"?

I am reading about I2C. On this site: http://playground.arduino.cc/Main/WireLibraryDetailedReference#endTransmission It says that endTransmission() can return one of the following status codes: 0: Successful send. 1: Send buffer too large for the…
Mads Skjern
  • 1,085
  • 3
  • 13
  • 23
9
votes
3 answers

I2C LCD Serial Interface Board not displaying text (wrong pins?)

I have a 1602 LCD screen that works fine on its own. However I wanted to free some pins by using an I2C / IIC LCD controller I purchased separately. While the controller seems to be communicating with my Arduino UNO on the right address, I cannot…
Bort
  • 397
  • 2
  • 6
  • 18
9
votes
4 answers

How do functions outside of void loop work?

I am used to Arduino sketches with a void setup() part that runs once, and a void loop() part that keeps looping. What happens when you have void functions outside of the main void loop()? Will these all keep looping in parallel or do they run one…
Blue7
  • 235
  • 2
  • 4
  • 8
8
votes
2 answers

How to choose alternate I2C pins on ESP32?

I'm a begginer with Arduino and this may be a basic question but I'm facing an issue. I'm using a HTU21D sensor with an ESP32. This sensor use I2C communication. Inside the Arduino library, there is this function to start to collect data: //Start…
Gazouu
  • 263
  • 2
  • 4
  • 10
8
votes
2 answers

Burning sketch with I2C

Not a pure Arduino question really. I'm actually using a standalone ATmega168. So far I've been using AVR-ISP programmer (working from AVR Studio) to program the chip. After everything is done, the chip will be covered and I will only have access to…
tsf144
  • 243
  • 1
  • 8
7
votes
2 answers

Is there a pullup on I2C?

I am using an Arduino Uno R3. It is not clear on the schematic whether there are pullups on the A4 and A5 I2C pins. Are there hardwired pullups or do I have to add them myself?
harry_p_6
  • 175
  • 9
7
votes
3 answers

Sainsmart LCD 2004 - LiquidCrytal_I2C library issue unable to compile

I bought a Sainsmart LCD2004 from Amazon to use with my Arduino Uno. I understand that since this LCD uses I2C a new library needs to be downloaded. From the sainsmart website I dowloaded the LCD 2004…
Caesar
7
votes
3 answers

Multiple I2C sensors with the same address

I am trying to find the simplest way to connect multiple (preferably around 10-20) IMU sensors to one controller. There are two constraints: sampling at 60Hz and reasonably simple wiring as I want to put it on clothes. I am totally new to the…
Łukasz Kidziński
  • 173
  • 1
  • 1
  • 7
7
votes
3 answers

I2C 2 way communication between Arduino Uno and Arduino Mega

If I remove the transmission code from slave this works properly but I need to transmit from slave. Here is my master code #include void setup() { Wire.begin(3); Wire.onReceive(receiveEvent); } byte x = 0; void loop() { …
srinivas
  • 83
  • 1
  • 1
  • 4
7
votes
3 answers

ATTiny85 I2C LCD

My setup is as follows: Arduino IDE 1.6.11 Arduino Pro Mini as ISP ATTiny85 1602A LCD with I2C board The libraries I use are: TinyWireM (source: https://github.com/adafruit/TinyWireM) LiquidCrystal_I2C (modified for ATTiny) (source:…
Thijs
  • 422
  • 1
  • 6
  • 21
7
votes
3 answers

Sending and receiving different types of data via I2C in Arduino

I have found a few good tutorials on how to send and receive data via I2C in connected arduinos. My limitation is now how to transmit different types of data like for instance, long, float, etc. Right now the communication via I2C using the wire…
Camilo
  • 359
  • 2
  • 4
  • 12
7
votes
5 answers

Alternatives to Wire library for I2C

I am looking for (reasonably easy to use and well tested) alternatives to the Wire library. Wire works very well, but: I only need the Arduino to act as I2C master and the Wire library seems to be a real waste of resources: My goal is to send out…
fuenfundachtzig
  • 1,485
  • 1
  • 13
  • 25
1
2 3
48 49