Category : i2c

I know that having an arduino with multiple slave addresses is impossible, however i wish to have an arduino that starts out at address A, and if a condition is met switch to address B instead. So not multiple slave addresses, since they’d be one at a time. I simply wish to change it in ..

Read more

Please find the below code snippet and let me know that ways to troubleshoot. #include <stdbool.h> #include <stdint.h> #include <stdarg.h> #include "inc/hw_i2c.h" #include "inc/hw_memmap.h" #include "inc/hw_types.h" #include "inc/hw_ints.h" #include "driverlib/gpio.h" #include "driverlib/i2c.h" #include "driverlib/interrupt.h" #include "driverlib/pin_map.h" #include "driverlib/sysctl.h" #include "driverlib/uart.h" #include "utils/uartstdio.h" #include "driverlib/gpio.h" #define SLAVEADDRESS_EXT 0x65 #define NUM_OF_I2CBYTES 255 #define reg_noOp 0x00 #define reg_decodeMode ..

Read more

When I see code written for communication via I2C with external EEPROMs and RTCs and such, I always notice that when sending the register address bytes and data byte using Write.write(), the hexadecimal address is type-casted into a byte or int like below: static uint8_t read_i2c_register(uint8_t addr, uint8_t reg) { Wire.beginTransmission(addr); Wire.write((byte)reg); Wire.endTransmission(); Wire.requestFrom(addr, (byte)1); ..

Read more

I inherited I2C API to PX4 for reading data from magnetometer, but when I compile the project, an error occurs. Here is my code and error message: class BNO055 : public device::I2C, public I2CSPIDriver<BNO055> { public: BNO055(I2CSPIBusOption bus_option, int bus, int bus_frequency); virtual ~BNO055(); static I2CSPIDriverBase *instantiate(const BusCLIArguments &cli, const BusInstanceIterator &iterator, int runtime_instance); . ..

Read more