查看Noduino I2C Scan的源代码
←
Noduino I2C Scan
跳转到:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您刚才请求的操作只有这个用户组中的用户才能使用:
用户
您可以查看并复制此页面的源代码:
== 代码示例 == <source lang=cpp> #include "noduino.h" void setup() { serial_begin(115200); wire_begin(); } void loop() { byte error, address; int nDevices; serial_printf("I2C Scanning...\r\n"); nDevices = 0; for (address = 1; address < 127; address++) { // The i2c_scanner uses the return value of // the wire_endTransmisstion to see if // a device did acknowledge to the address. wire_beginTransmission(address); error = wire_endTransmission(); if (error == 0) { serial_printf("I2C device found at address 0x%02X\r\n", address); nDevices++; } else if (error == 4) { serial_printf("Unknow error at address 0x%02X\r\n", address); } } if (nDevices == 0) serial_printf("No I2C devices found\r\n"); else serial_printf("done\r\n"); delay(25*1000); } </source> <br><br>
返回到
Noduino I2C Scan
。
个人工具
登录
名字空间
页面
讨论
变换
查看
阅读
查看源代码
查看历史
操作
搜索
导航
首页
社区专页
新闻动态
最近更改
随机页面
帮助
工具箱
链入页面
相关更改
特殊页面