Questions tagged [wire-library]
Use this tag for the Wire library, used for I2C/TWI communication.
102 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
1
answer
38
views
Send uint32_t over i2c from attiny85 slave to atmega328p master
I run into an issue with querying a uint32_t with an atmega328p master from an attiny85 master.
I have put both codes below.
I did run the equivalent code for just sending a uint8_t and all works ...
1
vote
0
answers
58
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 ...
2
votes
0
answers
93
views
MPU9250 and MPU6050 not working with SAMD21 board
I am trying to use an MPU6050 with my SAMD21-based board (a LightAPRS W-2), but it doesn't work.
The sensor definitely works, as I can get data from another 3.3 Vlogic-level board, and the sensor ...
1
vote
1
answer
2k
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 ...
0
votes
0
answers
84
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 ...
1
vote
1
answer
620
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 ...
-2
votes
1
answer
1k
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 ...
1
vote
2
answers
592
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 ...
0
votes
1
answer
112
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 ...
7
votes
0
answers
410
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 I2C. The IC responds to an address read packet with 16 uninterrupted bits representing its state.
However, since I2C ...
1
vote
0
answers
42
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 ...
1
vote
0
answers
1k
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 ...
2
votes
0
answers
226
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 ...
1
vote
0
answers
177
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 ...
3
votes
1
answer
4k
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 ...