数字信号与模拟信号
了解开/关状态与平滑范围之间的区别
数字信号与模拟信号 是 CoddyKit 上的免费 Arduino & IoT Academy 课时。 这是第 1 节课,共 4 节。 你可以在下方免费阅读本课时的完整内容 — 然后在浏览器中使用内置代码编辑器和全天候 AI 导师进行实践。 这是 Arduino & IoT Academy 学习路径的一部分,你的进度在网页和 CoddyKit 应用中同步。 Arduino & IoT Academy 课程共包含 4 节课。
本课时的部分内容尚未翻译,以英文显示。
Two Kinds of Signal
Electronics speak in two languages. A digital signal is simple on or off, while an analog one varies smoothly. Both matter in your projects.
Digital Means On or Off
A digital signal has only two states: HIGH or LOW, like a light switch. There is nothing in between, just yes or no.
Analog Means a Range
An analog signal can be any value across a range, like a dimmer slowly fading a lamp from off to full brightness.
The Real World Is Analog
Temperature, light, and sound never jump between two values. They flow smoothly, so the real world is mostly analog by nature.
Voltage Carries the Value
On an Arduino, an analog reading is really a voltage between 0V and 5V. A higher voltage simply means a higher value.
A Button Is Digital
A push button is the perfect digital input. It is either pressed or not, so you read it as HIGH or LOW with digitalRead.
A Knob Is Analog
A turning potentiometer sends a smoothly changing voltage. Turn it slowly and the value glides, so you read it as analog.
Different Pins for Each
The Uno keeps them separate. Digital pins are labeled D0 to D13, while the analog input pins are labeled A0 to A5.
Two Functions to Read
You match the function to the signal: digitalRead for on or off pins, and analogRead for the smooth analog inputs.
int btn = digitalRead(2);
int knob = analogRead(A0);Analog Gets Digitized
Your chip cannot truly feel a smooth voltage. An ADC converts that analog voltage into a number the code can use.
Why the Difference Matters
Choosing the right type avoids bugs. Read a sensor with analogRead and a switch with digitalRead, and your data stays correct.
Quick Check
Which input belongs to the analog world?
Recap: Digital vs Analog
You learned that digital is on or off while analog is a smooth range. Buttons are digital, knobs are analog. Match the read function to each.
常见问题解答
「数字信号与模拟信号」课时是免费的吗?
是的 — 「数字信号与模拟信号」的完整文本可在网页上免费阅读。要进行交互式练习(内置代码编辑器和全天候 AI 导师)并解锁 Arduino & IoT Academy 课程的其余内容,请升级到 CoddyKit PRO。 Arduino & IoT Academy 课程共包含 4 节课。
「数字信号与模拟信号」这节课中我会学到什么?
了解开/关状态与平滑范围之间的区别 你通过在浏览器中直接运行的动手代码来练习 Arduino & IoT Academy,全天候 AI 导师会在你学习这节课的过程中回答你的问题。
学习 Arduino & IoT Academy 需要有经验吗?
无需任何先前经验。CoddyKit 上的 Arduino & IoT Academy 课程适合初学者到高级学习者,你可以从这里开始或从头开始,按照自己的节奏学习。 这是第 1 节课,共 4 节。
「数字信号与模拟信号」课时需要多长时间?
大多数 CoddyKit 课程大约需要 5–10 分钟。每节课都很精短且互动,所以你能稳步进步,并在网页和应用中从离开的地方继续。
我能在这节 Arduino & IoT Academy 课中编写并运行代码吗?
能。每节 Arduino & IoT Academy 课都包含内置代码编辑器,你可以在浏览器中直接编写并运行真实代码,并获得即时 AI 反馈 — 无需本地设置。