输入、输出与现实世界
了解传感器如何读取世界,以及执行器如何改变世界
输入、输出与现实世界 是 CoddyKit 上的免费 Arduino & IoT Academy 课时。 这是第 3 节课,共 4 节。 你可以在下方免费阅读本课时的完整内容 — 然后在浏览器中使用内置代码编辑器和全天候 AI 导师进行实践。 这是 Arduino & IoT Academy 学习路径的一部分,你的进度在网页和 CoddyKit 应用中同步。 Arduino & IoT Academy 课程共包含 4 节课。
本课时的部分内容尚未翻译,以英文显示。
Two Directions
Every Arduino project is built from two flows: information coming in from the world, and signals going out to change it. 🙂
Inputs Bring Data In
An input is anything that tells your board about its surroundings, like a button being pressed or a room getting warmer.
Sensors Read the World
A sensor is an input device that measures something real, heat, light, or distance, and hands your board a number.
Outputs Push Action Out
An output is how your board changes the world: lighting an LED, spinning a motor, or beeping a buzzer.
Actuators Do the Doing
An actuator is an output that creates physical action, like a motor that moves or a speaker that makes sound.
Pins Carry Both
The same Arduino pins handle both jobs. You simply tell each pin in code whether it should listen or speak.
Setting a Pin's Role
You declare a pin's direction with one command. Here pin 13 is set up as an output so it can drive an LED.
pinMode(13, OUTPUT);Reading an Input
To listen instead, you read a pin's value. This grabs the state of a button wired to pin 2 so your code can react.
int state = digitalRead(2);The Loop That Joins Them
The magic is connecting them: read an input, decide, then drive an output. That tiny chain is the core of every gadget.
A Familiar Example
A motion light reads a sensor for movement, then drives a lamp on. Input in, output out, just like you'll build.
Why It Matters
Master inputs and outputs and you can build almost anything. Every project you'll make is just a clever mix of these two.
Quick Check
Let's sort inputs from outputs.
Recap
Inputs and sensors bring data in; outputs and actuators push action out. Read, decide, act, that loop powers every device. 🔁
常见问题解答
「输入、输出与现实世界」课时是免费的吗?
是的 — 「输入、输出与现实世界」的完整文本可在网页上免费阅读。要进行交互式练习(内置代码编辑器和全天候 AI 导师)并解锁 Arduino & IoT Academy 课程的其余内容,请升级到 CoddyKit PRO。 Arduino & IoT Academy 课程共包含 4 节课。
「输入、输出与现实世界」这节课中我会学到什么?
了解传感器如何读取世界,以及执行器如何改变世界 你通过在浏览器中直接运行的动手代码来练习 Arduino & IoT Academy,全天候 AI 导师会在你学习这节课的过程中回答你的问题。
学习 Arduino & IoT Academy 需要有经验吗?
无需任何先前经验。CoddyKit 上的 Arduino & IoT Academy 课程适合初学者到高级学习者,你可以从这里开始或从头开始,按照自己的节奏学习。 这是第 3 节课,共 4 节。
「输入、输出与现实世界」课时需要多长时间?
大多数 CoddyKit 课程大约需要 5–10 分钟。每节课都很精短且互动,所以你能稳步进步,并在网页和应用中从离开的地方继续。
我能在这节 Arduino & IoT Academy 课中编写并运行代码吗?
能。每节 Arduino & IoT Academy 课都包含内置代码编辑器,你可以在浏览器中直接编写并运行真实代码,并获得即时 AI 反馈 — 无需本地设置。
此课程中的所有课时
- 从计算机到微控制器
- “物联网”是什么意思
- 输入、输出与现实世界
- 您的第一个智能设备创意