Arduino 寻找I2C地址address
参考:http://henrysbench.capnfatz.com/henrys-bench/arduino-projects-tips-and-more/arduino-quick-tip-find-your-i2c-address/
Arduino Quick Tip: Find Your I2C Address
Contents [show]
Don’t Get Hung Up When You Want to Play
You’ve just received your new module and you want to test it. You go back the seller’s web page and find instructions that are only slightly clearer than mud. In fact, one of things you discover as you attempt to unravel the odd form of English that is used is that you can’t seem to figure out what the I2C address is.
You can certainly find the data sheet for the device that the module is built around. With a little work, you should also be able to identify the address pins. Then, with a little probing, you can identify the address.
In fact, at some point in your project development, it may even become necessary. Alas, sometimes you only have a few minutes to play and you just want to see the freaking thing work.
If that describes you, then try running the following sketch. It will scan I2C possible addresses and report the address of the device that responds.
address of the device that responds.
.HenryBenchResponsive { width: 320px; height: 100px }
@media (min-width: 800px) { .HenryBenchResponsive { width: 468px; height: 60px } }
@media (min-width: 1125px) { .HenryBenchResponsive { width: 728px; height: 90px } }
I2C Scanner By Nick Gammon
Copy, Paste, Upload and Run!
// I2C Scanner
// Written by Nick Gammon
// Date: 20th April 2011 #include <Wire.h> void setup() {
Serial.begin (115200); // Leonardo: wait for serial port to connect
while (!Serial)
{
} Serial.println ();
Serial.println ("I2C scanner. Scanning ...");
byte count = 0;
Wire.begin();
for (byte i = 8; i < 120; i++)
{
Wire.beginTransmission (i);
if (Wire.endTransmission () == 0)
{
Serial.print ("Found address: ");
Serial.print (i, DEC);
Serial.print (" (0x");
Serial.print (i, HEX);
Serial.println (")");
count++;
delay (1); // maybe unneeded?
} // end of good response
} // end of for loop
Serial.println ("Done.");
Serial.print ("Found ");
Serial.print (count, DEC);
Serial.println (" device(s).");
} // end of setup void loop() {}
I2C Scanner Results
Run the sketch and you will see a result that looks something like this:

Arduino 寻找I2C地址address的更多相关文章
- Arduino通过I2C(PCF8574T)驱动1602LCD
Arduino中使用I2C通信可直接调用Wire.h库, 这个库允许Arduino链接其他I2C设备, 链接线有两条, 分别是SDA(数据行)和SCI(时钟线). 各型号Arduino的I2C对应引脚 ...
- Arduino通过I2C(SSD1306)驱动0.96寸12864OLED
I2C驱动的128x64 OLED I2C (Inter-Integrated Circuit) 集成电路总线是I2CBus的简称, 是一种串行通信总线, 使用多主从架构. 飞利浦公司在1980年代为 ...
- Davinci-DM6467板子-外围器件的I2C地址的疑惑解答
这篇文即调试标清视频或者说调试TVP5147和ADV7343所使用的程序名称为video_sd_playback_480i_composite 我们用的是合众达公司(SEED)的SEED-DVSD64 ...
- 地址(Address)——WCF学习笔记(2)
地址(Address)分为: 统一资源表示(URI). EndpointAddress. 端口共享. 逻辑地址与物理地址. 请求监听与消息分发.
- The three day 给你一个有效的 IPv4 地址 address,返回这个 IP 地址的无效化版本
""" 给你一个有效的 IPv4 地址 address,返回这个 IP 地址的无效化版本. 所谓无效化 IP 地址,其实就是用 "[.]" 代替了每个 ...
- 通过PEB寻找函数地址
通过PEB的Ldr参数(结构体定义为_PEB_LDR_DATA),遍历当前进程加载的模块信息链表,找到目标模块. 摘自PEB LDR DATA: typedef struct _PEB_LDR ...
- 第2章地址Address(WCF全面解析3)
WCF顾明思义,就是在Windows平台下解决通信(C,Communication)的基础框架(F,Foundation)问题. 终结点是WCF最为核心的对象,因为它承载了所有通信功能.服务通过相应的 ...
- 23.实现一个名为Person的类和它的子类Employee,Employee有两个子类Faculty 和Staff。 具体要求如下: (1)Person类中的属性有:姓名name(String类型),地址address(String类型), 电话号码telphone(String类型)和电子邮件地址email(String类型); (2)Employee类中的属性有:办公室office(Stri
package banking; public class Person { private String name; public String address; public String tel ...
- 地址(Address)——统一资源表示(URI)——WCF学习笔记(2)
统一资源标识(URI) URI:Uniform Resource Identifier(统一资源标识),唯一地标识一个网络资源的同时也表示资源所处的位置的方式(资源访问所用的网络协议). URI结构: ...
随机推荐
- React设计模式相关
关于我在React设计模式上做的一些思考: 一,项目里实战的经历 最开始我根据组件不同的职能定义,拆分了展示组件和容器组件两大类,后来随着业务逻辑越来越复杂,容器组件代码越来越冗长,我又加入了HOC高 ...
- Pytest allure自定义特性场景功能
@allure.feature @allure.story allure支持用户对测试用例进行功能模块的自定义,并展示在报告中 需要在测试用例代码中加上装饰器@allure.feature[加在测试类 ...
- P1164 小A点菜(动态规划背包问题)
题目背景 uim神犇拿到了uoi的ra(镭牌)后,立刻拉着基友小A到了一家--餐馆,很低端的那种. uim指着墙上的价目表(太低级了没有菜单),说:"随便点". 题目描述 不过ui ...
- InnoDB 引擎中的索引类型
首先索引是一种数据结构,并且索引不是越多越好.合理的索引可以提高存储引擎对数据的查询效率. 形象一点来说呢,索引跟书本的目录一样,能否快速的查找到你需要的信息,取决于你设计的目录是否合理. MySQL ...
- jenkins通过API触发构建任务
添加一个可变参数 配置token 参数用 ${参数名称} 引用 外部调用url地址:ip:port/view/视图名称/job/任务名称/buildWithParameters?token=test& ...
- 吴恩达《深度学习》-课后测验-第一门课 (Neural Networks and Deep Learning)-Week 2 - Neural Network Basics(第二周测验 - 神经网络基础)
Week 2 Quiz - Neural Network Basics(第二周测验 - 神经网络基础) 1. What does a neuron compute?(神经元节点计算什么?) [ ] A ...
- js中的鼠标滚轮事件
## 事件对象 event 1 event事件对象,表示用来获取事件的详细信息,比如得到鼠标的横坐标:事件对象.clientX(clientX是可视区坐标) window.onclick = func ...
- hystrix文档翻译之如何使用
Hello World! 使用HystrixCommand实现“Hello World”. public class CommandHelloWorld extends HystrixCommand& ...
- ERP与EHR系统的恩怨纠葛--开源软件诞生13
ERP中需要EHR的存在吗--第13篇 用日志记录"开源软件"的诞生 [点亮星标]----祈盼着一个鼓励 博主开源地址: 码云:https://gitee.com/redragon ...
- Java锁?分布式锁?乐观锁?行锁?
转载自:公众号来源:码农翻身 作者:刘欣 Tomcat的锁 Tomcat是这个系统的核心组成部分, 每当有用户请求过来,Tomcat就会从线程池里找个线程来处理,有的执行登录,有的查看购物车,有的下订 ...
