Questions tagged [wire-library]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
77 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
33 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
17 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
26 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
45 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
60 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
42 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
52 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
29 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
302 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
87 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
48 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
2answers
624 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
6k 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
361 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
1k 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
82 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
327 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
595 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
137 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
353 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
1k 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
736 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
425 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
1k 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
106 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
314 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
587 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
869 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
528 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
691 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
576 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
411 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
117 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
215 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
884 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
512 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
328 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
649 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
698 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 &...
0
votes
2answers
621 views

I2C communication between 2 Arduinos with updated wire library

I would like to enable communication between two Arduino 101. From what I have read, the best method is to use I2C using the wire library. However, it seems as though the newest Arduino IDE has an ...
5
votes
2answers
5k views

Wire.h not found!

Here's the code that's making this error: #include "Wire.h" Here's the error: fatal error: Wire.h: No such file or directory #include "Wire.h" ^ compilation terminated. Error ...
-1
votes
1answer
634 views

How to request data via I2C?

How do you program an Arduino Uno to request data over I2C, sending parameters defining the request? I'm trying to program Arduino A to read a sensor value from another Arduino B, and it first needs ...
3
votes
2answers
762 views

Wire Library send/receive

I'm doing a project that includes an Arduino Uno and custom hardware made by me. Everything is working perfectly independently, and I'm trying to implement a way for them (the Arduino and my hardware) ...
0
votes
2answers
3k views

SPISettings was not declared in this scope

I'm trying to compile a simple I2C example to read data from an MPU-6050 accel/gyro sensor, but I'm getting the compilation error: /usr/share/arduino/libraries/SD/src/utility/Sd2Card.cpp:27:8: error: ...
1
vote
1answer
152 views

Arduino Uno Wire Transmission Issues

I am developing code to run a word clock and have noticed a slight problem. I am using a DS3231 to keep time, and using the Wire library to communicate with it. I ping the DS3231 every second to get ...