首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何检测Raspberry Pi板卡型号?

如何检测Raspberry Pi板卡型号?
EN

Stack Overflow用户
提问于 2021-04-22 00:09:32
回答 1查看 30关注 0票数 0

我现在正在与几个覆盆子Pi板。我有Pi Zero W,3B+和4B。

我将在所有这些模型上运行相同的程序。为此,我需要从Python代码中检测Raspberry板模型。像这样,

代码语言:javascript
复制
def detect_board():
    '''
    return string representing board type, one of the following
        4B
        3B+
        3B
        ...
        Zero W
        Zero
    '''

如何获取线路板型号名称?

EN

回答 1

Stack Overflow用户

发布于 2021-04-22 00:24:10

感谢@Ani的评论,我像这样创建了检测函数,

代码语言:javascript
复制
def detect_model() -> str:
    with open('/proc/device-tree/model') as f:
        model = f.read()
    return model
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67199531

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档