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结构: ...
随机推荐
- windows设置定时执行脚本
如果你写了一些Python程序,想要在特定的时间进行执行,例如你想让一段爬虫程序在每天的上午10点执行一次,那么我们就可以来使用windows自带的定时任务进行设置.由于Windows系统,无法使用L ...
- jdk1.8 新增工具类
目录 optional 时间API Instant localDateTime LocalDate LocalTime Duration TemporalAdjuster DateTimeFormat ...
- CentOS+Phpstudy安装Sqli-Labs
CentOS+Phpstudy安装Sqli-Labs 安装环境 CentOS 7.5 vmware fusion phpstudy 安装步骤 1. 下载sqli-labs 2. 将sqli-labs ...
- 原生JDK网络编程- Buffer
Buffer用于和NIO通道进行交互.数据是从通道读入缓冲区,从缓冲区写入到通道中的.以写为例,应用程序都是将数据写入缓冲,再通过通道把缓冲的数据发送出去,读也是一样,数据总是先从通道读到缓冲,应用程 ...
- postman -- 环境变量、全局变量使用
背景: [登录接口]中会返回sign值,[学生金币充值接口]会则需要用到该sign值,因此把sign设置为环境或全局变量,便于其他接口调用. 1.请求登录接口,获取sign值: 2.把sign值添加至 ...
- mysql数据库常见问题修改(待补充)
1.修改mysql最大连接数的方法:临时修改:1.使用命令show variables 来查看当前最大连接数 show variables like '%max_connections%'; 使用命令 ...
- Git | Git入门,成为项目管理大师(一)
大家好,周一我们迎来了一个新的专题--git. 写这个专题的初衷有两点,第一点是觉得好像很少有公众号提到git相关的技术,可能是觉得太基础了看不上.但实际上git非常重要,在我们实际的开发工作当中使用 ...
- apache环境搭建(xampp跑不起来)
写在前面:之前(2016年)学jq时,学到ajax时,需要搭建apache,我开始安的xampp集成好的软件包,但是我的电脑咋弄都跑不起来,找了好多方法还是没用,最后无奈宣告放弃.但是皇天不负有心人, ...
- 使用U盘的PE系统安装Windows10操作系统 - 初学者系列 - 学习者系列文章
今天闲来无事,就把windows 10的安装再重写一个文(以前写过一个:安装免费的正版Windows10操作系统 - 初学者系列 - 学习者系列文章 ). 1. 制作一个WinPE的U盘. 相信现 ...
- Docker实战(3):Tomcat部署
运行环境:centos7,Docker version 1.13.1,docker tomcat version 8.5.50 创建文件(为映射文件做准备,非固定) mkdir -p /tomcat/ ...