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验证当前是设备是电脑端还是手机端
<?php // 验证设备为PC还是WAP $agent = $_SERVER['HTTP_USER_AGENT']; if(strpos($agent,"comFront" ...
- 获取android手机的屏幕分辨率 android开发
/** * 获取屏幕分辨率 */ private void getResolution() { // TODO Auto-generated method stub Display display = ...
- maven踩过的坑
maven配置 maven默认配置 解决每次打开idea的spring项目都需要重新配置maven,选择file/other settings/preference for new projects ...
- Webpack 入门指迷
大概算是一份教程吧, 只不过效果肯定不如视频演示之类的好..Webpack 最近在英文社区上经常看到, 留了心, 但进一步了解是通过下边的视频:视频: How Instagram.com Works, ...
- 跟着尚硅谷系统学习Docker-【day04】
day04-20200716 p18.docker容器数据卷 docker容器中的数据,做持久化. 容器关闭以后容器内的数据就没有了. 保存到数据库或者服务器宿主机里面. 作用:容器间可以 ...
- Html中让输入框input和紧接在后的按钮button在垂直方向上对齐
<table border="0px" width="360px"> <tr><td colspan="10" ...
- 浏览器调试的必知必会,零基础足够详细-第一节console面板、移动端调试
前言 本文已经发布视频点击查看 开发过程中,浏览器的调试非常重要,可以说是必备的技巧,本文我就会分享一些自己掌握的技巧,欢迎补充 我们默认使用Chrome浏览器,但是你使用新edge浏览器也是可以的 ...
- Linux(CentOS7)安装Tomcat (Tomcat+JDK)
安装Tomcat首先要安装jdk,jdk和tomcat安装可以使用的方法:将jdk.tomcat上传到Linux,然后解压后使用,另一种方法是直接使用在线安装:yum 第一步:安装jdk,在Linux ...
- PowerJob 应对庞大任务的锦囊妙计:MapReduce
本文适合有 Java 基础知识的人群 作者:HelloGitHub-Salieri HelloGitHub 推出的<讲解开源项目>系列.讲解 PowerJob 系列即将接近尾声,本系列的干 ...
- 前端直传文件到aliyun OSS
<template> <div id="container"> <div class="img-item m-1 upload-file&q ...