Questions tagged [i2c]

Inter-Integrated Circuit (I²C) is a bus for low speed peripherals. Use this tag for questions regarding how to use I²C with an Arduino, or for problems with I²C and your Arduino.

Filter by
Sorted by
Tagged with
0
votes
2answers
295 views

Why it's not possible to manipulate the TWSR directly? [closed]

I think I forgot the reason for this SFR manipulation in microcontrollers; like, checking the TWSR in twi. The technique for checking the values of the TWSR is by masking it with another variable or ...
0
votes
1answer
449 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 ...
0
votes
1answer
264 views

FIS1100 (IMU)/ I2C/ Arduino

I am a student and currently doing a semester project. The first goal is to get accelerometer and gyroscope data from FIS1100 using the Arduino (Uno). I've got the FIS1100 Evaluation Kit user guide ...
0
votes
1answer
170 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 ...
0
votes
1answer
680 views

Multimaster I2C with same address

I use the Wire Library and need to have multi-master setting. I see multi-master examples, where the masters have their own ID's -- which make sense. Now I have just connected three devices on the ...
0
votes
1answer
790 views

Using 2 GY521(mpu6050)s with Arduino Uno R3

I am working on creating a motion sensor based on an Arduino and MPU6050 interface. I'd like to retorfit my code to be able to read 2 mpu6050 devices. Besides defining a 0x69 address and setting AD0 ...
0
votes
1answer
323 views

Confusion receiving I2C data from magnetic sensor

So, I've found the address of my device using a I2C device scanner. I then looked up the datasheet for a magnetic sensor I am trying to grab data from. I'm now trying to communicate with the device ...
0
votes
1answer
1k views

HMC5883L not working in continuous mode!

I'm just starting with the HMC5883L, I'm writing my code with C and also my own I2C library. I noticed that the values on the Arduino IDE's serial monitor are constant. Then I developed a function ...
0
votes
2answers
157 views

Hardware interrupts for buttons not directly assigned to pins

The Adafruit LCD shield offers an LCD and access to 4 button, using only a two wire connection with the Arduino. This is achieved with the MCP23017 I2C port expander IC. These buttons are not ...
0
votes
1answer
352 views

How to change a code for an I2C 16x2 to a 20x4?

I have found a sketch that someone wrote for a rotary encoder controlled LCD menu. The code is for an I2C that is 16x2 and I have an I2C that is 20x4. With the code that I found, the layers are all ...
0
votes
1answer
194 views

Reading HMC5883L hex values in 2's compliment C code

I want to develop my C code for HMC5883L. I have 2 questions for my current code development. My first question is: But what I found in the datasheet is that the values are in the 2's compliment, so ...
0
votes
1answer
399 views

Connecting an Arduino Nano, Mega and LCD via I2C works but fails when shutting down Mega

I have connected an Arduino Nano, Mega and a LCD via I2C/TWI (SDA/SCL). The Nano is playing the master while Arduino Mega and LCD are slaves. This works well till I power off the Arduino Mega. Of ...
0
votes
1answer
185 views

(SOLVED) Fast HW check: (18 digital + 4 analog to I2C ) Arduino Mini Pro + MCP23017 or STM32?

Arduino Mini Pro+MCP23017 or STM32 I want make device, which reads 17 digital buttons and 4 analog, process it somehow and send the result to I2C bus. Also there is a LED to be managed. I may want ...
0
votes
1answer
5k views

The working of a MFRC522 and its Interface protocols?

I've actually messed up and posted into the stackoverflow site, even though I'm probably not meant to. I've been given this datasheet, but even though it does explain somewhat how each host interfaces ...
0
votes
1answer
544 views

Cutting off OneWire/SDA line with transistors

I am developing a pcb for a design I am working on and I need to share a pin to be used by a ds18b20 (onewire) and some possible I2C sensors. There would be just one of each at a time. I was thinking ...
0
votes
1answer
838 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 ...
0
votes
1answer
6k views

OVF in serial monitor instead of data

I am currently working with two Arduinos and I'm trying to synchronize them. I want to get data from four LIS3DH accelerometers. The LIS3DH accelerometers are connected to the Arduino using I2C ...
0
votes
1answer
1k views

ESP8266-12E and MCP23017 , unable to identify the application

After googling much I have found that MCP23017 can be used with esp8266-12e for more number of output pins. I have tried all the programs from different tutorials on internet but could not make it ...
0
votes
1answer
307 views

Detecting I2C transfer with LED

I am going to do a project with a lot of Arduinos connected via I2C, where like of them can became master for a moment to announce an event. So I would like to see how much is the bus used. As there ...
0
votes
1answer
462 views

How to use potentiometer data from slave to master Arduino?

I'm trying to make a game where i can use one Arduino as a controller (the controller is a potentiometer) and the other Arduino sending the signals to the computer. Im trying to figure out ...
0
votes
1answer
424 views

Does receiving data with SPI stop the main loop?

I have a loop of code running on a Mega 2560 that is running at a certain speed, which I get from an Arduino Uno. I have tried to talk with I2C but when I receive the data from I2C, the whole code ...
0
votes
1answer
461 views

Arduino bug when “myFile = SD.open” is inside loop()

My Arduino resets / bugs each time I put myFile = SD.open in loop(). In setup() it works fine. I have a 20*4 LCD and an RTC connected to I2C, an SD card reader connected to SPI, and a fingerprint ...
0
votes
1answer
168 views

SPI Overflow in 328 slave with i2c sensor

I am working on creating sensor poller that is going to be polling multiple sensors and then, on request, provides its data to the master. The master polls the slave (SPI) at 50hz and the slave is ...
0
votes
1answer
2k views

How to turn I2C Sensors on and off with an Arduino Mega 2560?

I want to turn on and off I2C Sensors with the Arduino Mega 2560. I use one max. 0.4A NPN Transistor, which controls the Vcc line to the sensor. When I plug my Arduino into my laptop and the sketch ...
0
votes
1answer
365 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 ...
0
votes
1answer
476 views

Arduino which library for led 4x20

I am having an Arduino Uno and I want to add a LCD to it. My LCD is a C2042A with I2C shield on it. I tried the LiquidCrystal_I2C library but it doesnt work. I am not getting any errors the LCD is ...
0
votes
2answers
752 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 ...
0
votes
1answer
166 views

Arduino i2c communication between another arduino and a sensor

Can the following scenario exist? Microcontroller 1 sends a code to microcontroller 2 to start reading sensor data. Then Microcontroller 2 reads sensor data from sensor and sends it back to ...
0
votes
1answer
2k views

I/O expander with i2c interface vs Multiplexer

I am wondering where are the difference in between using something like: CD4067, which selects which pins to read/write from by "selecting" an address with 4 pins by writing to it. Versus the MCP23017 ...
0
votes
1answer
897 views

Code: Switch case and loop problem [closed]

Please am working on this automatic drink dispenser, i got a sample code as am still an amature. I seem to be stuck and i please need assistance. Components: I2C, keypad, LCD peristaltic pump. ...
0
votes
1answer
121 views

DS1307 RTC not working with CC3000 WiFi shield (I2C bus hangs)

I am trying to use a DS1307 (from Sparkfun, BOB-12708) with an Arduino Leonardo. I have connected the SDA, SCL, GND, and 5V pins from the RTC to the Arduino. However, with a CC3000 WiFi shield on the ...
0
votes
1answer
1k views

Second I2C address not accepted

I have set up 2 DHT22 sensors and 2 BMP280 sensors with an Arduino Uno SMD R3 board. The DHTs are working fine and are outputting correct temperature and humidity values to the Serial monitor. The ...
0
votes
1answer
224 views

PFC8574 4x4 keypad: correct wiring?

I bought a few PFC8574 and 4x4 keypads for a small project. I'm unclear on the correct wiring of the keypad to the PFC8574. On the Arduino Playground's site, there are pull-up resistors for each ...
0
votes
1answer
145 views

Arduino sketch won't run until I open up GUI in processing

I am trying to make a human detection robot using D6T omron thermal sensor. However, I am facing some problem here. My Arduino Uno didn't run the sketches until I open up my GUI in processing. The tx/...
0
votes
3answers
593 views

Can someone explain how to program i2C communications without using the library?

I am starting to get into i2C, SPI, and other forms of communication. I have read about them and have a fuzzy idea of how they work electrically, but can someone explain how I would turn the ...
0
votes
1answer
476 views

Regarding using I2C with Arduino for Silicon Micro-structure 5852 D 1.5 psi

I am trying to get output from a sensor (micro-structure 5852D), but I only get two outputs: 11 and 255 for even applying pressure. The following is my code, please show me how to over come this ...
0
votes
1answer
66 views

i2c address instead of assigning pins

I found this sketch online and would like to reuse it. I do have a dot-matrix-display, that is accessable through an i2c with the address 0x70. How do I change the code to be able to use the hardware ...
0
votes
1answer
400 views

Where am I supposed to get an I2C BUFFER_LENGTH defined?

I am using a BLE nano - as soon as I try to include I2Cdev.h and compile, I get this error: Arduino\libraries\I2Cdev\I2Cdev.cpp:276:62: error: 'BUFFER_LENGTH' was not declared in this scope How ...
0
votes
1answer
276 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> ...
0
votes
1answer
316 views

LCD Pin Numbering vs I2C Controller Pin Numbering vs Sketch

I've been playing with an Arduino Uno, trying to get a 16x2 LCD screen to work with an I2C controller. I've got this LCD screen and this controller. And I've been trying to get the sketch below to ...
0
votes
1answer
1k views

I2C_Anything String / Char Array issues

I've been working with the lovely I2C_Anything.h (thanks to the great work and support from Nick over at http://www.gammon.com.au/forum/?id=10896&reply=9#reply9).. All working great, I was using ...
0
votes
2answers
46 views

Is it possible to specify a pin upon which the data sent over i2c can act?

A master will send fan speed values to the slave. The slave will then read the fan speed values and change the speed value for the relevant pwm pin. However I am not sure how I can tell the slave ...
0
votes
1answer
805 views

I2C Master send reset command to the slave counter

My name is Gianni, I live in Olbia Sardinia Italy and I have some experience in electronics. For several years I have been passionate about Arduino. They are now engaged in a project to counter with ...
0
votes
1answer
386 views

Unexpected output form Serial.println

So I have a teensy and an arduino uno connected together via I2C, however some very odd behavior is occurring, when monitoring the serial connection for shorter data sent over I2C I receive the ...
0
votes
1answer
441 views

Arduino messing up as slave over I2C

I have an Arduino Mega2560 and a Raspberry Pi hooked up through I2C. The Pi is acting as the master, while the Arduino is the slave. While sending data over I2C, the int message gets messed up and ...
0
votes
1answer
428 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 ...
0
votes
2answers
816 views

How do I connect two slaves of same type in I2C?

I am not experienced about I2C communications, but I do happen to have two HMC5883L magnetometer modules that I wish to connect to a single arduino. It uses I2C protocol, and hence the slave device ...
0
votes
1answer
188 views

About arduino serial communication

I've used the arduino uno with the python serial library months ago and some packets got lost in the way. I've been searching about serial communication for arduino and I've been thinking that I could ...
0
votes
1answer
968 views

Best way to interact arduino and python

So, i've worked with the pySerial module for python, where I communicated with my arduino via serial. However, this module only works for 32bits and I would like to make my project work on both ...
0
votes
0answers
22 views

OLED display on I2C causes esp8266 to reset

I have connected two temp sensors and an OLED display to a NodeMCU using I2C. When the program reaches the instruction to print the measurements on the display the program crashes and NodeMCU resets ...

1
7 8
9
10 11
13