繁体   English   中英

arduino TFT屏蔽干扰BNO055 (I2C)

[英]arduino TFT shield interference with BNO055 (I2C)

我的设置:

arduino uno R3 || 种子工作室底座 SHIELD
|| hiletgo ILI9341 TFT 显示屏 SHIELD

底座屏蔽上的 I2C 连接器 <----> Adafruit BNO055

我正在编译我的代码而不使用#define USE_ADAFRUIT_SHIELD_PINOUT; 这意味着它将使用示例中 header 的引脚排列:

// The control pins for the LCD can be assigned to any digital or
// analog pins...but we'll use the analog pins as this allows us to
// double up the pins with the touch screen (see the TFT paint example).
#define LCD_CS A3 // Chip Select goes to Analog 3
#define LCD_CD A2 // Command/Data goes to Analog 2
#define LCD_WR A1 // LCD Write goes to Analog 1
#define LCD_RD A0 // LCD Read goes to Analog 0

#define LCD_RESET A4 // Can alternately just connect to Arduino's reset pin

    // When using the BREAKOUT BOARD only, use these 8 data lines to the LCD:
    // For the Arduino Uno, Duemilanove, Diecimila, etc.:
    //   D0 connects to digital pin 8  (Notice these are
    //   D1 connects to digital pin 9   NOT in order!)
    //   D2 connects to digital pin 2
    //   D3 connects to digital pin 3
    //   D4 connects to digital pin 4
    //   D5 connects to digital pin 5
    //   D6 connects to digital pin 6
    //   D7 connects to digital pin 7
    // For the Arduino Mega, use digital pins 22 through 29

请注意,A4 和 A5 未使用,因此它们应该可用于 I2C 协议。

基本上我想从 BNO 中读取一些内容并显示在屏幕上。

屏幕亮起,BNO 亮起。

但是在液晶显示屏变黑之后不久。 我能够将问题追溯到位于 Adafruit_BNO055.cpp 中的以下行:

bool Adafruit_BNO055::readLen(adafruit_bno055_reg_t reg, byte *buffer, uint8_t len)

这是使用 _wire 调用。

如果我清空这个 function(将所有内容注释掉),那么屏幕仍然处于活动状态(但显然没有从 BNO055 读取任何内容。

问题:

  1. 我为什么要处理这种干扰?

  2. 假设我能够编译它并使用#define USE_ADAFRUIT_SHIELD_PINOUT 运行它,这是否意味着屏幕也将使用 I2C,而我的所有数字和 A0-A3 都可用于其他用途?

  3. 为什么使用#define USE_ADAFRUIT_SHIELD_PINOUT 声明我的与ILI9341 兼容的屏幕无法正常运行? HiLetgo 与 Adafruit 不兼容吗? 不同的I2C地址?

除了 I2C 连接之外,忽略连接到板上的插头。 我在运行这个程序之前删除了这些。

谢谢!

使用专用数据接口解决了问题,使 A0--A5 端口可用于 I2c。 然后不再干扰

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM