Serial.begin e Taxa de Transmissão
Abra o canal USB na velocidade correspondente.
Serial.begin e Taxa de Transmissão é uma aula grátis de Arduino & IoT Academy no CoddyKit. Esta é a aula 1 de 4. Você pode ler a aula completa abaixo gratuitamente — depois pratica ao vivo no navegador com um editor de código integrado e um tutor de IA 24/7. Faz parte do caminho de aprendizado de Arduino & IoT Academy, e seu progresso é sincronizado entre a web e o app CoddyKit. O curso de Arduino & IoT Academy inclui 4 aulas no total.
Partes desta aula ainda não foram traduzidas e aparecem em inglês.
A Two-Way Channel
Your board can talk to your computer over the same USB cable that powers it. That conversation is called Serial communication. 🔌
Why Serial Matters
A microcontroller has no screen, so Serial is how you peek inside it. You print messages and watch them live on your computer.
Open the Channel
Before any printing, you must open the connection with Serial.begin(). You do this once, inside setup().
void setup() {
Serial.begin(9600);
}What Is Baud Rate?
The number you pass to begin is the baud rate: how many signal changes per second travel down the wire. It sets the speed of the chat.
9600 Is the Classic
A baud rate of 9600 is the friendly default. It is slow but rock solid, so most beginner sketches start there.
Serial.begin(9600);Faster When You Need It
You can go faster, like 115200, to stream lots of data without lag. Higher speed means more bytes per second.
Serial.begin(115200);Both Sides Must Agree
Here is the golden rule: the baud rate in your code must match the one set in the Serial Monitor, or you get garbage characters.
Garbage Means Mismatch
If your monitor shows weird symbols like ⸮⸮⸮, do not panic. It almost always means the baud rate on the two sides is different.
It Belongs in setup
Put Serial.begin() in setup(), not loop(). You only open the channel once, then it stays open for the whole program.
void setup() {
Serial.begin(9600);
}
void loop() {
}Wait for the Port
On some boards you add while (!Serial) to pause until the USB port is truly ready before you start printing.
Serial.begin(9600);
while (!Serial) { }Pick One Speed
Choose a baud rate and stick with it across your whole project. Mixing speeds between sketches is the most common Serial headache.
Quick Check
You set Serial.begin(9600) but the Monitor shows random symbols. What is most likely wrong?
Recap
You opened a USB chat with Serial.begin() in setup, learned that baud rate sets the speed, and that both sides must agree on it. 🎉
Perguntas Frequentes
A aula “Serial.begin e Taxa de Transmissão” é grátis?
Sim — o texto completo de “Serial.begin e Taxa de Transmissão” é grátis para ler aqui na web. Para praticá-la interativamente (um editor de código integrado e um tutor de IA 24/7) e desbloquear o restante do curso de Arduino & IoT Academy, atualize para CoddyKit PRO. O curso de Arduino & IoT Academy inclui 4 aulas no total.
O que vou aprender em “Serial.begin e Taxa de Transmissão”?
Abra o canal USB na velocidade correspondente. Você pratica Arduino & IoT Academy com código prático que executa diretamente no navegador, e um tutor de IA 24/7 responde suas dúvidas enquanto trabalha na aula.
Preciso ter experiência prévia para começar Arduino & IoT Academy?
Nenhuma experiência prévia é necessária. Arduino & IoT Academy no CoddyKit é estruturado para alunos iniciantes até avançados, então você pode começar aqui ou desde o início e aprender no seu ritmo. Esta é a aula 1 de 4.
Quanto tempo leva a aula “Serial.begin e Taxa de Transmissão”?
A maioria das aulas CoddyKit leva cerca de 5–10 minutos. Cada uma é compacta e interativa, então você faz progresso constante e retoma exatamente de onde parou entre web e app.
Posso escrever e executar código nesta aula de Arduino & IoT Academy?
Sim. Cada aula de Arduino & IoT Academy inclui um editor de código integrado, então você escreve e executa código real direto no navegador e recebe feedback de IA instantaneamente — nenhuma configuração local necessária.
Todas as aulas deste curso
- Serial.begin e Taxa de Transmissão
- Serial.print versus println
- Veja os valores dos sensores ao vivo
- Leia os comandos que você digita