The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [wire-library]

Use this tag for the Wire library, used for I2C/TWI communication.

Filter by
Sorted by
Tagged with
0
votes
0answers
21 views

Arduino MKR1000 crashes when adding wire.h library

I am trying to use the i2c library wire.h with my Arduino MKR1000. I can compile and upload the simple test program but after uploading, the Arduino resets and doesn't come back (won't connect to the ...
0
votes
1answer
29 views

I2C Wire.onRequest not detected

I want to know why Wire.onRequest can not detect below massage and what I can do to detect it.(I am not able to change I2C massage) I was able to read this part of the massage with wire.onReceive: ...
-1
votes
0answers
44 views

When to use Wire.begin method?

I have problem with I2C(second I2C on STM32). I use I2C for SH1106 display(0x3C), DS3231 RTC module(0x68) and AT24C32 EEPROM chip(0x57). Only thing I did is in Wire library changed from TwoWire Wire(1)...
1
vote
2answers
96 views

Arduino I2C Wire.onReceive hangs after a few loops

I have an Arduino Leonardo (master) and a Polulu A-star 328 PB(slave). I intend to use the slave to actuate some servos. I've modified the code from https://www.arduino.cc/en/Tutorial/MasterWriter to ...
0
votes
1answer
107 views

i2c Connection for MCP4725(Dac) with Esp8266 wemos d1 mini

------------ This question has been edited ------------ note: Dac and Adc is12bits my problem : I use two ESP. Using esp1, I read the Adc amount of the alternating signal (ECG) and send it to esp2 ...
0
votes
0answers
38 views

Servo PWM Pin seems to be interfering with Wire.onRequest i2C function

A newbie here. I am thinking of interfacing Raspberry Pi with Arduino via I2c to control a few servo motor (as RPi have limited PWM pins). Meaning I would send input from RPi to Arduino to allow to ...
0
votes
1answer
20 views

Wire SlaveReceiver : will the registered function in onRecieve interrupt/conflict with loop block?

I am currently researching on I2C, and I made a configuration that has MasterWriter that transmits data to a SlaveReceiver that will store the data received from Master, into an SD card, and then ...
1
vote
0answers
30 views

Can't get MMC3416xPJ to work

I needed a magnetometer with a high Output Data Rate (ODR). This is because I wanted to measure AC magnetic fields of around 20-80 Hz. So I decided to go with the MMC3416xPJ prototyping board which ...
0
votes
2answers
51 views

Sharing serial output from one to many arduinos (plus a computer) via USB hub

I am trying to send rotary encoder output from an UNO to seven Trinket M0s and a computer via a (powered) USB hub. Currently the UNO → Laptop bit works great, serial monitoring works via the hub ...
1
vote
1answer
68 views

Working with Wire core library

I'm studying the Wire library code driver utility/twi.h to learn how twi buffering and ISR management work. What I did actually, is that I copied the header/source files from the Arduino path F:\...
0
votes
2answers
43 views

Questions about HMC5883L library

I'm studying the structures of libraries currently. I want to learn how good programmers write code, what are the strategies they follow, the art the programmer followed to develop the library. And ...
1
vote
1answer
64 views

Wire.h missing - Failing to upload I2C 16x2 LCD sketch

I am total newbie in Arduino and for the last 3 days I am trying to figure this out. I would like to use an I2C display for a project. I have installed the LiquidCrystal_I2C, but when I try to upload ...
0
votes
0answers
30 views

Wire doesn't work between Uno & ESP32S & ESP8266

I think i've reached my limit. I can't get Wire to work between an Uno or ESP8266 or ESP32S. On the Uno I had them connected like SDA via Uno SDA -> ESP32 GPIO21 SCL via Uno SCL -> ESP32 GPIO22. I ...
0
votes
1answer
393 views

Issues with I2C and Wire.Available()

I am working on a project which requires communication from an Arduino Due (Master) and an FDC2214Q1 C to D IC (Slave), but there is some variability as to whether the code works or not depending on ...
0
votes
1answer
106 views

Same output on displays with different I2C-addresses (AdaFruit library, ESP32)

I've got two displays hooked up to a ESP32 via I2C and I'm using the AdaFruit library. All handling display output is packed in a own library. As I was testing I only had one display set up and ...
0
votes
0answers
54 views

Multiple Atmega328p wired communication

I am using multiple ATMEGA328Ps (4 ATMEGA328P) (OR Arduino Unos). The distance between two farthest ATMEGAs is 14 meters (One is Master Device and Other is Node), and other 3 are connected to each ...
0
votes
1answer
65 views

Sketch starts and keeps counting on external power supply but not usb

Thank you for the add, total newbie here (electronics and arduino) on his first project. Trying to make a counter for a hay baler with two HAL effect sensors, (pin 5 & 6) and outputting to an I2C ...
0
votes
1answer
215 views

Why does my 16x2 LCD displays weird letters and can't insert key from keypad?

I'm a newbie on Arduino here, and this is my first project on 16x2 LCD, 4x4 keypad and others. So, the story is, after I uploaded the program for my group's Arduino alarm clock to the Arduino board, ...
0
votes
2answers
735 views

I2C call during Wire.requestFrom

Which I2C command happen during Wire.requestFrom(address, quantity)? Is it correct that Wire put a Start condition, then 7-bit address appended with read bit? How would that be different from Wire....
5
votes
2answers
7k views

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 ...
1
vote
1answer
417 views

How to avoid calling multiple times Wire.begin() in libraries?

it's all in the title ; I'm developping a library and use *TwoWire pointers in this library ; but I am using an external library that calls Wire.begin(). I've seen something about TWCR register in ...
2
votes
1answer
2k views

Wire.h library works on Uno but won't compile for ATtiny85

TL;DR: Arduinos are current hungry so I want to switch my microcontroller code works on Uno, I change upload to ATtiny85, code doesn't compile Wire.h breaks at the TWBR input Should I keep trying to ...
0
votes
1answer
87 views

Not clear code procedure in Arduino wire library

The application code of sparkFun, has the following line which is difficult to understand. It's requested 6, because it's requesting 6 bytes for HMC5883L module. Wire.requestFrom(address, 6); if(6&...
0
votes
1answer
355 views

Reconnect to I2C with a different address (ATTiny85)

My project requires to reconnect to an I2C bus as a slave. I can't reset my ATTiny physically because I2C + my project + a pin to trigger the reset isn't possible due to the limited amount of pins ...
1
vote
2answers
1k views

I2C from two masters (ATtiny85, ESP8266) to one slave (ATmega328)

I've been working on a project with I2C protocol where an ATmega328 (Arduino) configured as slave, receives messages from an ATtiny (ATtiny85, ATTinyCore by SpenceKonde) configured as master, or from ...
0
votes
1answer
649 views

Arduino Wire communication with MCP23008 GPIO pin expander to turn on an LED with a button press

I am using an Arduino Uno and an MCP23008 GPIO pin expander, I have a momentary button connected to GPIO 2 on the MCP23008 and an LED light connected to GPIO 1 on the MCP23008. What I want is for the ...
0
votes
1answer
142 views

Servo jitter with two atmegas

So i'm building my own quadcopter at this moment and I have designed a flight controller board for it using two atmega328p's. I've programmed it so that the first atmega receives al the data from ...
2
votes
1answer
378 views

I2C communication between Arduino Due and Nano

I'm trying to communicate between two Arduino Due and Nano. Nano as Master and Due as a slave. As given in the library description Wire Lib When the master request for data from the slave, first it ...
0
votes
1answer
2k views

Reading values from TTP229 capacitive touch sensor on arduino

I would like to be able to read the raw capacitive sensor values from a TTP229 chip through i2c in Arduino. I have one of these breakout boards to play with : My goal is to get values similar to ...
2
votes
2answers
816 views

Arduino I2C via USB Serial cable? [closed]

An Arduino UNO is given. I want to establish an I2C communication channel between Arduino UNO and a Linux Machine which have only USB ports available to communicate with peripherals. Currently I can ...
0
votes
1answer
1k views

Wire library compatibility Arduino Pro Mini - nodeMCU (I2C/TWI) problem

I'm writing PortExtender, a library to convert an Arduino Pro Mini in a port expander and I ran into what seems to be a compatibility problem between Arduino and nodeMCU: I got different answers ...
1
vote
1answer
437 views

Communicating with I2C DAC (LTC2631)

Firstly, let me say that I'm new to using I2C devices, especially with Arduino. I have an 8-bit DAC (LTC2631) that I'm trying to control with an Arduino Uno. I thought I would be able to use the ...
1
vote
1answer
2k views

How can Arduino know Wire.available() is true or false?

In this part of code void readFrom(byte device, byte fromAddress, int num, byte result[]) { Wire.beginTransmission(device); Wire.write(fromAddress); Wire.endTransmission(); Wire.requestFrom((...
0
votes
1answer
107 views

Different questions regarding Arduino C++ library coding style

I'm reading the two wire library in Arduino libraries and in the C++ source code I found different methods which I don't know what they mean, in the following: // Initialize Class Variables /////////...
0
votes
1answer
335 views

TWI Wire.setClock() on non arduino AVR MCU issue

Using an Atmega168P - programmed by means of avrdude with the .hex file generated by Arduino IDE. The following code sets the 8 MHz Atmega's TWI interface to just 15.625 kHz: Wire.begin(); // ...
0
votes
1answer
628 views

I2C MCP4725 DAC connection speed

I'm trying to use the MCP4725 DAC from Adafruit (https://www.adafruit.com/product/935) to output some waveforms over a frequency range up to about 50kHz. At the moment, I'm simply sending values to ...
3
votes
3answers
2k views

I2C Wire.write function doesn't seem to work

Using the simplest code possible to test the library: #include <Wire.h> void setup() { Wire.begin(); // join i2c bus Wire.beginTransmission(44); // transmit to device #44 (0x2c) ...
0
votes
2answers
897 views

Tiny RTC I2C module not working

I bought a Tiny RTC I2C module and it doesn't work. When i run the TimeRTCSet from TIME library all i get is: Unable to sync with the RTC 0:00:00 0 0 1970 0:00:01 1 1 1970 0:00:02 1 1 1970 0:00:03 1 ...
1
vote
1answer
569 views

I2C wire.h send 2 variables

I am trying to send 2 variables with wire.h. I tried with this code: MASTER RECEIVER: #include <Wire.h> // include la libreria #include <LiquidCrystal_I2C.h> #include "RTClib.h" ...
3
votes
2answers
722 views

Replace Wire library with TinyWireM

I want to integrate Pololu's vl53l0x Time of Flight distance sensor into a project of mine. They created a library to interface with the vl53l0x over I2C, which works great on my Uno. The only problem ...
2
votes
1answer
607 views

wire.h multiple slave addresses

Is it possible to use wire.h on an Arduino Uno to act as a slave for more than one address? For example I'd like it to emulate two different devices, one at I2C address 23 and the other at address 57....
1
vote
3answers
440 views

wire.h onReceive only triggering once

I am writing a program to emulate a LCD driver chip (PCF8576) in a piece of equipment where I need to replace an unobtainable LCD display. I have wire.h set up and the code in place to decode chip ...
5
votes
2answers
4k views

Which library to choose? <Wire.h> or “Wire.h”?

I know that in C++, to include a library, you either put the library name in <x> or "x". Now, I believe that this was because of a major change in the C++ language a some time ago. Now, in ...
1
vote
2answers
119 views

Update Variable via Arduino to Arduino I2C

I am attempting to send a simple 1 byte value from one arduino to another using I2C with the Wire library. From reading I see that this is typically done using the event monitor supplied by the Wire ...
1
vote
0answers
224 views

I2C between Yun Shield (Dragino) and UNO R3 problem

I am having problems with I2C communications between my Dragino Yun and an Arduino UNO R3. I can have the Dragino request data (using Wire.onRequest on UNO) from the UNO and it works great, however, ...
1
vote
0answers
927 views

How to prevent Wire.requestFrom from hanging?

I'm trying to read data from an Arduino Uno I2C slave via Wire.requestFrom() on an Arduino Uno master. The slave's onRequest handler is simply: void I2C_Send() { byte myArray[4]; myArray[0] = ...
0
votes
1answer
529 views

How to make PCA9685 work with Arduino Due?

I have Arduino Due and PCA9685. I use this library: https://github.com/adafruit/Adafruit-PWM-Servo-Driver-Library The board does not do anything with servo connected. I tried to use SDA/SCL pins and ...
0
votes
1answer
337 views

How can I determine how many bytes an I2C master read from my Arduino acting as I2C slave?

I have an Atmega328 programmed using the Arduino software and libraries (but is standalone on on a board in the TSOP package) without bootloader and with ISP programming). I am using the Wire library ...
2
votes
2answers
683 views

Arduino Wire.h send double to lcd

I'd like the double number 200.00 shown as 200.00 on my LCD screen. For instance, when I pass just a number (int) like 40 to the LCD, it uses it as an ASCII code to show a character on the display. ...
1
vote
3answers
737 views

Arduino Wire.h library: how to communicate with an LCD?

I am having an Arduino Uno and a C2042A LCD with I2C shield on it. Because the VirtualWire library does not work for me. I tried only the wire library but it's still not working: My code: #include &...