Questions tagged [wire-library]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
2k 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" ...
Francesco Valla's user avatar
1 vote
3 answers
2k 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 &...
Number_987's user avatar
1 vote
1 answer
248 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 ...
MZimmerman6's user avatar
1 vote
1 answer
458 views

Modifying Arduino IMU library to rely on DSSCircuit's I2C Master Library

For an Arduino project I am working on, I am trying to modify the SparkFun 6 Degrees of Freedom IMU Digital Combo Board - ITG3200/ADXL345 to support DSSCircuit's I2C Master Library (https://github.com/...
John Doe's user avatar
1 vote
2 answers
657 views

Switch MPU6050 to send SCL data through A4 and SDA through A5

I have this MPU6050, and like most of the other MPU6050s, it is set up for SCL to be attached to A4 and SDA to be attached to A5. I have this shield on my Arduino Uno, which is configured for ...
Richard Beattie's user avatar
1 vote
1 answer
769 views

I2C hookup - sketch just crashes

I am encountering problems with I2C when trying to attach a 9DoF Sensor to my Arduino Uno. Following these instructions (the hardware setup I have is like in the schematic) I noticed the basic example ...
kontur's user avatar
  • 173
1 vote
0 answers
42 views

slave arduino receiving commands from two serials

I have a slave arduino connected to a master arduino mega (through UART) and to a RPi (through USB). The slave arduino is set to monitor various SHT85 (through I2C) and NTC sensors. What I would like ...
higgsboson2012's user avatar
1 vote
0 answers
40 views

Problem when using Servo.h and WIre.h libraries [duplicate]

I have a project that consists of an Arduino, a NodeMCU and 2 servos. The NodeMCU is configured as master and the Arduino as slave. I have bidirectional flow of data between them. In order to receive ...
Alex Mod's user avatar
1 vote
0 answers
803 views

I2C / TWI: set up atmega328p as slave

I try to run an atmega328p as a i2c slave. even with the bare minimum the slave acts as its not wired at all: NACK is transmitted after request (see logic analyzer). The master should read a constant ...
micro_'s user avatar
  • 21
1 vote
0 answers
145 views

Unable to write, or read a sensor's registers. Do I have an error in my code?

I'm trying to write to register the change some settings for a sensor I'm using (BNO055) and then read the same register to verify if the changes are successful. However, the only value I'm able to ...
Zhelyazko Grudov's user avatar
1 vote
0 answers
219 views

Configuring the registers of i2c AD converter ADS122C04

I am not able to set the configuration registers of the TI´s converter chip ADS122C04 using arduino MEGA via I2C. The code mainly consists of the following: 1-reset the chip (one byte) 2-choose ...
Ilyes Ben 's user avatar
1 vote
0 answers
224 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 ...
user58068's user avatar
1 vote
0 answers
63 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 ...
Matt L's user avatar
  • 11
1 vote
0 answers
178 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 ...
JavaEnthusias's user avatar
1 vote
1 answer
750 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 ...
janizer's user avatar
  • 49
0 votes
2 answers
909 views

ESP8266 not working with MPU 6050 over wire library and I2C

I'm trying to use this version of ESP8266 to access MPU 6050. However, it's not working. https://www.amazon.com/gp/product/B07HF44GBT/ref=ppx_yo_dt_b_asin_title_o07_s00?ie=UTF8&psc=1 i.e. ...
ShoutOutAndCalculate's user avatar
0 votes
2 answers
112 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 ...
R1S8K's user avatar
  • 283
0 votes
1 answer
646 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(); // ...
kellogs's user avatar
  • 127
0 votes
1 answer
77 views

Erratic behaviour using a DUE with the Microchip 24FC64 EEPROM chip?

I am attempting to read and write from/to an EEPROM chip, and have got access to this 64 kbit device. It appears I can write to the device and read from it, but there appears to be some strangeness ...
J Collins's user avatar
  • 295
0 votes
2 answers
1k views

Cannot display a chr string using Wire.read() and u8g2.drawStr()

I'm still getting myself acquainted with C++, so I expect this is a very basic issue I'm facing. I've got an OLED screen connected to a Teensy LC and can display text on it just fine. The Teensy ...
lowercasename's user avatar
0 votes
2 answers
6k 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....
Dzung Nguyen's user avatar
0 votes
1 answer
448 views

NodeMCU V3 and MPU6050 strange values

I am new to this platform, so please if I do something against the regular rules please let me know so I can learn. Now my problem: I have a nodeMCU V3 connected to a MPU6050. Using my Arduino Uno I ...
sanrays10's user avatar
0 votes
1 answer
1k views

Sending more than BUFFER_LENGTH(32) bytes in slave answer I2C

I need to send 259 bytes as answer to I2C master read request. AFAIK there is a buffer limit of 32 bytes in Wire.h and in HW (Arduino Nano). Is there a way sending 259 byte answer, or I have to choose ...
Libor Tomsik's user avatar
0 votes
1 answer
862 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: ...
Shahreza's user avatar
  • 165
0 votes
2 answers
275 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 ...
laffan's user avatar
  • 25
0 votes
1 answer
3k 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 ...
tyler a's user avatar
  • 73
0 votes
1 answer
938 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, ...
Nur Syahzanani Huda's user avatar
0 votes
1 answer
201 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&...
R1S8K's user avatar
  • 283
0 votes
1 answer
819 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 ...
PolygonGraphics's user avatar
0 votes
1 answer
173 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 /////////...
R1S8K's user avatar
  • 283
0 votes
1 answer
1k 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 ...
janizer's user avatar
  • 49
0 votes
1 answer
499 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 ...
nanofarad's user avatar
  • 103
0 votes
2 answers
1k 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 ...
cyrusbehr's user avatar
  • 101
0 votes
1 answer
297 views

Olimexino 32u4: Wire.endTransmission() hangs

I'm trying to get a TAE5767 (FM radio) to work. According to this instructable I'm trying it on a 5V-Olimexino 32u4 (Leonardo-compatible) with following code (Arduino 1.6.3): #include <Wire.h> ...
Thomas S.'s user avatar
  • 566
0 votes
1 answer
442 views

pcDuino 3B Wire library errors

I recently purchased a pcDuino 3B and I am very pleased with the Board so far. I can use the preinstalled arduino IDE to program the board from the board and run programs. However, when I came to use ...
harry_p_6's user avatar
  • 175
0 votes
1 answer
1k views

Compilation error when trying to give pointer to a function to another function

I'm trying to write a library for Arduino using the Wire library. Here's my code: PiCom.h: #ifndef PiCom_h #define PiCom_h #include "Arduino.h" #include <Wire.h> class PiCom { public: ...
Geosearchef's user avatar
0 votes
0 answers
58 views

Compilation error with MMA8451 accelerometer and attiny85 using ATTinyCore

I am trying to use the Adafruit MMA8451 accelerometer with an attiny85. The Adafruit library uses Wire which doesn't work on the attiny so I used the ATTinyCore board files which have been modified to ...
Struan Lawrie's user avatar
0 votes
1 answer
603 views

Wire Library Timer Usage

I would like to know if the Wire Library is using a Hardware Timer from the Arduino Mega 2560. And If so which Timer it is. As I am using the Timer 1. After implementing the Wire Library I have some ...
passischoppi's user avatar
0 votes
1 answer
193 views

Compass heading not varying linearly

I am using an HMC-5983 magnetometer compass on my arduino uno to find the heading of a car I'm building.But my compass readings aren't varying linearly.For example when I physically turn my compass by ...
AfiJaabb's user avatar
  • 219
0 votes
1 answer
341 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 ...
cfu479's user avatar
  • 3
0 votes
1 answer
2k 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 ...
user avatar
0 votes
2 answers
1k 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 ...
Velociraptor's user avatar
0 votes
1 answer
821 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 ...
Sergey Kravchenko's user avatar
0 votes
2 answers
4k 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: ...
Cerin's user avatar
  • 1,628
0 votes
1 answer
440 views

Using a class instance with Wire.onReceive

Is it possible to register a class instance member function with Arduino's Wire.OnReceive? I'm trying to make my code object-oriented, and want a specific non-static class function to handle I2C data,...
Cerin's user avatar
  • 1,628
-1 votes
1 answer
221 views

MAX9611/2 - receiving junk data

I'm connecting to a MAX9611 on a custom PCB (using a SAMD Cortex M0 running an Adafruit Feather bootloader) using I2C. I have code that reads the voltage, current and temperature from the internal ...
Joe of Loath's user avatar
-1 votes
1 answer
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 ...
juliusbangert's user avatar
-1 votes
1 answer
1k 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 ...
navid's user avatar
  • 25
-1 votes
1 answer
96 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 ...
Lumpy's user avatar
  • 1
-1 votes
1 answer
2k 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 ...
Cerin's user avatar
  • 1,628