极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 10483|回复: 0

用arduino 模拟i2c eeprom,收不到资料

[复制链接]
发表于 2014-1-13 22:29:31 | 显示全部楼层 |阅读模式
arduino (A) 弄个简单的程序读写i2c eeprom (配上24c32都能正常读写,地址是0x50)
arduino (B) 代码如下

  1. #include <Wire.h>

  2. volatile int aa=0;
  3. void setup()
  4. {
  5.   Wire.begin(0x50);   
  6.   Wire.onReceive(receiveEvent);
  7.   Wire.onRequest(requestEvent);
  8. }

  9. void loop() {
  10. }


  11. void receiveEvent(int howMany)
  12. {
  13.   aa++;
  14. }


  15. void requestEvent()
  16. {
  17.   aa++;
  18. }
复制代码


打印aa,都是0  , 貌似不能收到arduino (A) 來的任何讯息

请问哪出了问题了?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|联系我们|极客工坊

GMT+8, 2026-6-7 18:01 , Processed in 0.040120 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表