Feedback
Feedback

If you are having issues with the exercises, please create a ticket on DevZone: devzone.nordicsemi.com
Drag & Drop Files, Choose Files to Upload 您最多可以上传 2 个文件。
  • 简体中文
    Eng
    简体中文
  • 第 6 课 – 串行通信 (I2C)

    概览

    与传感器和外部组件进行通信是微控制器执行的一项非常常见的任务。内部集成电路 (I2C) 总线是一种用于与外部组件通信的流行协议。在本课中,我们将回顾 I2C 的基础知识,并学习如何使用 nRF Connect SDK 中的 I2C 外设驱动程序与外部传感器进行交互。通常,在 nRF Connect SDK/Zephyr 中,传感器驱动程序是作为一个单独的模块“设备驱动程序”开发的。但是,在本课中,我们的重点是学习 I2C API,因此我们将使用这些 API 直接从应用程序与传感器进行交互。

    本课有两个练习,具体取决于您使用的开发板:

    • 练习 1 — 使用带有 I2C 和 SPI 接口连接器的 BME280 传感器板。开发者学院上的另一个练习将需要 SPI 连接器(Thingy 系列设备不支持)。
    • 练习 2 – 使用 Thingy:91 或 Thingy:53 连接到板载的 BH1749 颜色传感器。

    这两个练习都演示了如何使用 I2C 驱动程序,因此只需完成其中一个即可。

    目标

    • 学习如何在 nRF Connect SDK 中使用 I2C 驱动程序
    • 通过动手练习实践如何使用 I2C 驱动程序 API
    • 使用 I2C 总线与外部传感器通信

    特殊硬件要求

    对于练习 1:

    重要提示

    练习 1 也可以使用 X-NUCLEO-IKS01A3 完成;但是,不推荐将其用于新设计(已弃用的硬件)。如果您有兴趣使用 X-NUCLEO-IKS01A3 完成练习,请按照 SDK 版本 v2.0.0 到 v2.6.2 的说明进行操作。

    对于练习 2:

    • Thingy 原型设计平台(Thingy:91 或 Thingy:53)

    Switch language?

    Progress is tracked separately for each language. Switching will continue from your progress in that language or start fresh if you haven't begun.

    Your current progress is saved, and you can switch back anytime.

    Register an account
    Already have an account? Log in
    (All fields are required unless specified optional)

    • 8 or more characters
    • Upper and lower case letters
    • At least one number or special character

    Forgot your password?
    Enter the email associated with your account, and we will send you a link to reset your password.