#!/mnt/run/tools/loran
print("-- Test i2c tools --")
local tmp = nil
local detect_bus = function(bus)
for chip = 0x0, 0x7F do
tmp = driver.i2cdev(bus, chip)
if tmp:init() == 0 then
if tmp:read_byte() >= 0 then
print(string.format("find i2c chip device %x ack: %d", chip,tmp:read_byte()))
tmp:release()
end
end
end
end
for bus = 0,1 do
bus = "/dev/i2c-"..bus
print("detect bus: "..bus)
detect_bus(bus)
end
linux 嵌入式 开发 lua 调试 i2c 脚本 i2c 总线
与本文相关的文章
- 从linux使用sz命令下载大于4g的文件到windows
- Windows、Linux下载安装&激活Pycharm专业版
- Linux—vimvi 翻页跳转命令快捷键
- windows任务计划程序运行bat文件,报错脚本错误:系统找不到指定的文件
- Windows子系统linux(wsl)环境下配置安装Openmpi及相应并行版Quantum Espresso
- 如何安装windows和linux双系统
- Linux网络设置
- windows系统内搭建跨架构linux虚机的方法
- Xshell在Windows和Linux间文件的上传和下载
- python在浏览器运行_如何在浏览器中运行python脚本?
- Python+Selenium 不打开谷歌浏览器运行脚本
- 龙蜥操作系统:又一个 Linux 操作系统?
- Edge浏览器安装篡改猴之后无法安装脚本
- CentOSLinux 挂载Windows NTFS 文件系统
- 基于Ventoy制作单个U盘引导Windows+Linux+黑苹果macOS
- windows的linux子系统忘记密码重新设置
- Win10下学习Linux的几种方法
- linux怎么查看一个文件夹的大小
- 【ONE·Linux || 网络基础(五)】
- 使用U盘安装Ubuntu(Linux系统)保姆教程
评论列表(0)
- 暂无评论