Questions tagged [wire-library]

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

Filter by
Sorted by
Tagged with
-1 votes
0 answers
45 views

How to read from specific registers with Wire library?

I'm having trouble figuring out how to read from multiple registers that are spaced apart using the Wire library. Primarily, I've read differing answers about how the write() command indexes through ...
Bruce's user avatar
  • 1
1 vote
0 answers
38 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
33 views

MPU9250 and MPU6050 not working on SAMD21 board

I am trying to use an MPU6050 with my SAMD21 based board (actually LightAPRS W-2), but it doesn't work. The sensor definitely works, as I can get data from another 3.3v logic-level board, and the ...
Charlie Nicholson's user avatar
1 vote
1 answer
425 views

Wire.write invalid conversion from ‘char*’ to ‘const uint8_t*

I have written this code: char message[4]; memcpy(message, &delta, 4); Wire.write(message, 4); When I try to compile I get this warning: warning: invalid conversion from ‘char*’ to ‘const ...
user88434's user avatar
0 votes
0 answers
39 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
1 vote
1 answer
261 views

Setup loops: never enters loop - restarting?

I uploaded the following to my UNO with WiFi: #include <SPI.h> #include <Wire.h> #include "Adafruit_CCS811.h" Adafruit_CCS811 ccs; // The air quality sensor String ...
user1505631's user avatar
-2 votes
1 answer
666 views

''Wire1' was not declared in this scope' in I2C_MPU6886 library

I recently purchased a 6-axis IMU MCP6886 module by M5Stack. Product link: https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/IMU_Unit. The example code provided by the manufacturer is ...
aninini's user avatar
1 vote
2 answers
451 views

Arduino Wire library and Type Cast help

I'm having troubles understanding this line of code that I see with every Arduino EEPROM tutorial. int saveLocation = 4095; Wire.write((int)(saveLocation >> 8)); Question 1: Do the parenthesis ...
AJ_Smoothie's user avatar
0 votes
1 answer
67 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
5 votes
0 answers
247 views

Handling non-standard I2C read response lengths with Wire library

I'm trying to read from a Sam&Wing XW12A 12 channel touch sensor IC using I²C. The IC responds to an address read packet with 16 uninterrupted bits representing its state. However, since I²C ...
Jim's user avatar
  • 151
1 vote
0 answers
37 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
595 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
2 votes
0 answers
152 views

Wire library causing samd21 based board to stop working

A bit of a general question, but asking in case someone has stumbled onto a similar problem before. A friend and I designed a custom PCB board based on the ATSAMD21G microprocessor. The board has a ...
Zhelyazko Grudov's user avatar
1 vote
0 answers
112 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
2 votes
1 answer
2k views

How detect I2C errors with requestFrom()

I am going to use MCP23017 chips, and some of them will be cabled with a 1 meter max unshielded cable. I am expecting that certain transmissions may toss errors. So I want to tackle this problems by ...
bask185's user avatar
  • 133
2 votes
2 answers
121 views

TTGO TS I²C adress

I'm working on a project using TTGO TS wich communicate wih arduino via I²C protocole How can I find the adress of TTGO TS board used in I²C communication ?
yusufes's user avatar
  • 21
0 votes
2 answers
831 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
2 votes
1 answer
945 views

Wire.endTransmission(false) hanging the program after running once when using MPU6050

For this project, I was using an Elegoo Car V3 and I was trying to add a gyroscope onto it. When I run the code for the car, my loop code iterates once and it is always able to read the sensor data. ...
Akash Dubey's user avatar
3 votes
1 answer
4k views

I2C communication between Arduino Uno and Nodemcu32-s (ESP32)

I want to send data between an ESP-32 (NODEMCU-32S) and an Arduino Uno but I haven't found any source on how to do that, so I tried this code: ESP-32 code: #include <Wire.h> void setup() { ...
Ahmed Moustafa's user avatar
3 votes
2 answers
570 views

I2C protocol doesn't work properly

I am trying to make I2C Communication between NodeMCU and arduino Uno boards. However it is not working properly. It makes communication for once time when i uploaded code. Master Device Code(NodeMCU ...
Snefru Clone's user avatar
5 votes
1 answer
138 views

Adafruit_LEDBackpack library interfering with analog input reading

I'm trying to do something I think would be simple. I'd like to read the input of a electret microphone board and update the Adafruit 24-segment LED Bar Graph. I got each individual item working ...
OneCleverMonkey's user avatar
0 votes
1 answer
494 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
-1 votes
1 answer
196 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 vote
0 answers
192 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
0 votes
1 answer
408 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
2 votes
1 answer
348 views

Unable to find/connect I2C devices (SHT31 & SGP30)

I have recently purchased an Arduino Nano 33 IOT together with two sensors: Adafruit SHT31-D (https://learn.adafruit.com/adafruit-sht31-d-temperature-and-humidity-sensor-breakout) Adafruit SGP30 (...
YouKnowNothingJohn's user avatar
0 votes
2 answers
818 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
1 vote
1 answer
335 views

Plant irrigation system

I'm very new to the Arduino game I wanted to make a small auto watering system for my plants. I bought these items 5V 1 CHANNEL RELAY MODULE FOR ARDUINO PIC AVR DSP ARMB 9 VOLT BATTERY SNAP ...
Nizam mulk's user avatar
0 votes
1 answer
169 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
2 votes
1 answer
127 views

FIXING BUG when Using Wire library to obtain compass heading

I am using the HMC-5983 magnetometer module to obtain the compass heading of a autonomous car I am building using the arduino platform.I'musing the Z axis and X axis to obtain the heading. However ...
AfiJaabb's user avatar
  • 219
0 votes
1 answer
949 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
774 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
1 vote
2 answers
2k 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 ...
Valentin Brasso's user avatar
-1 votes
1 answer
985 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 vote
0 answers
208 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
3 votes
1 answer
243 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 ...
aharahap3112's user avatar
2 votes
1 answer
194 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 ...
Nadim Ahmed's user avatar
0 votes
2 answers
250 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
1 vote
1 answer
756 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:\...
R1S8K's user avatar
  • 283
0 votes
2 answers
108 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
1 vote
1 answer
480 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 ...
saicode's user avatar
  • 111
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
0 votes
1 answer
2k 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
332 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
1 vote
0 answers
154 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 votes
1 answer
85 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
0 votes
1 answer
857 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
2 answers
5k 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
8 votes
2 answers
24k 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 ...
Gazouu's user avatar
  • 273
1 vote
1 answer
1k 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 ...
Storca's user avatar
  • 67