Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Arduino 是否可以使用两个不同的IDE进行I2C通信?_Arduino_Ide_I2c - Fatal编程技术网

Arduino 是否可以使用两个不同的IDE进行I2C通信?

Arduino 是否可以使用两个不同的IDE进行I2C通信?,arduino,ide,i2c,Arduino,Ide,I2c,我有一个Atmel AVR作为I2C主控,一个Arduino作为从控。AVR在Atmel Studio中编程,Arduino在Arduino IDE中编程。这种交流可能吗?如果没有,如何执行?我的问题是用于I2C事务的Atmel控制器使用一种格式来读取/写入命令。但我在Arduino找不到任何特殊命令。我怎样才能做到这一点 typedef struct { /* ! TWI chip address to communicate with. */ char chip; /* ! TW

我有一个Atmel AVR作为I2C主控,一个Arduino作为从控。AVR在Atmel Studio中编程,Arduino在Arduino IDE中编程。这种交流可能吗?如果没有,如何执行?我的问题是用于I2C事务的Atmel控制器使用一种格式来读取/写入命令。但我在Arduino找不到任何特殊命令。我怎样才能做到这一点

typedef struct {
  /* ! TWI chip address to communicate with. */
  char chip;
  /* ! TWI address/commands to issue to the other chip (node). */
  uint8_t addr[3];
  /* ! Length of the TWI data address segment (1-3 bytes). */
  int addr_length;
  /* ! Where to find the data to be written. */
  uint8_t *buffer;
  /* ! How many bytes do we want to write. */
  unsigned int length;
} twi_package_t; 
该代码是在I2C主机中传递的参数,即AVR。我的问题是第二个参数。你知道我该怎么做吗


谢谢。

I2C是一种不依赖IDE的标准协议。Arduino IDE有一个软件层,对普通用户隐藏内容,使他们能够实现I2C通信等功能。只要您的代码在两台机器上都是正确的,就绝对没有问题。

而且IDE只是一个奇特的文本编辑器,有一些方便的工具来创建软件。使用什么IDE并不重要。你的arduino只不过是一个atmel avr。。。如果你想知道i2c在arduino世界是如何实现的,你是否想过可以简单地用谷歌搜索arduino i2c?谢谢你的澄清,我已经添加了我的代码部分,如果可能的话,你能给我一个想法吗?