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结构: ...
随机推荐
- PHP 日期与时间函数详解
在开发过程中,我们经常碰到日期与时间戳相关的功能,今天趁此机会做个详细笔记. date_default_timezone_set('PRC'); /*把时间调到北京时间,php5默认为格林威治标准时间 ...
- Labview学习之路(五)按钮的机械动作
布尔类型中有一个按钮是非常重要的控件,他不是只是表示一个确定,输出0或1,下边我们共同探讨一下他的机械动作 单击时转换 释放时转换 保持转换直到释放 单击时触发 释放时触发 保持触发直到释放 单击时转 ...
- 【Docker】Docker安装运行dubbo-admin
运行dubbo-admin服务, 此服务需要单独启动一个zookeeper容器 dubbo-admin将监听所有注册到zookeeper的服务, dubbo-admin默认端口8080 1 运行一个z ...
- Mac本地生成SSHKey的方法
1. 查看秘钥是否存在 打开终端查看是否已经存在SSH密钥:cd ~/.ssh 如果没有密钥则不会有此文件夹,有则备份删除, 也可以直接删除, 2.生成新的秘钥, 命令如下 $ssh-keygen ...
- 算法专题 | 10行代码实现的最短路算法——Bellman-ford与SPFA
今天是算法数据结构专题的第33篇文章,我们一起来聊聊最短路问题. 最短路问题也属于图论算法之一,解决的是在一张有向图当中点与点之间的最短距离问题.最短路算法有很多,比较常用的有bellman-ford ...
- windows-服务器-配置一个及多个-Apache-Tomcat
问题:如何在一台服务器上发布了几个Tomcat的系统???怎么配置环境变量?怎么设置Tomcat? 2020/8月更新,由于之前的java的环境变量有点绕,此次新加一个流程设计图 一.需求: 一台wi ...
- 东方通Linux应用部署手册
东方通应用部署文档 进入东方通访问地址: http://192.168.0.12:9060/console/输入用户名密码(thanos/thanos123.com)首页是对东方通软件的一些信息描 ...
- ByteCTF2019
VIP 第一阶段: 先检查一下程序开的保护: 程序只开了canary和nx保护.接下来用IDA分析反编译出的伪代码 如上图,载edit函数中我们可以控制size的大小,并且程序没有做任何检查,我们再跟 ...
- (python)生产者消费者模型
生产者消费者模型当中有两大类重要的角色,一个是生产者(负责造数据的任务),另一个是消费者(接收造出来的数据进行进一步的操作). 为什么要使用生产者消费者模型? 在并发编程中,如果生产者处理速度很快,而 ...
- apache环境搭建(xampp跑不起来)
写在前面:之前(2016年)学jq时,学到ajax时,需要搭建apache,我开始安的xampp集成好的软件包,但是我的电脑咋弄都跑不起来,找了好多方法还是没用,最后无奈宣告放弃.但是皇天不负有心人, ...
