0Pricing
Arduino & IoT Academy · Aula

Posicione o cursor e exiba texto

Coloque o texto exatamente nas linhas e colunas desejadas.

Posicione o cursor e exiba texto é uma aula grátis de Arduino & IoT Academy no CoddyKit. Esta é a aula 3 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.

Text Has a Position

Every character lands at a specific spot on the screen. Controlling the cursor lets you place text exactly where you want it. 🎯

Columns Count from Zero

The 16 columns are numbered 0 to 15, left to right. Column 0 is the first character on a line.

Rows Count from Zero Too

The two rows are 0 and 1. Row 0 is the top line and row 1 is the bottom line.

Move the Cursor

Use setCursor to jump to a column and row before printing. The arguments are column first, then row.

lcd.setCursor(0, 1);

Print at That Spot

After setCursor, the next lcd.print() starts exactly where you placed the cursor instead of the top-left.

lcd.setCursor(0, 1);
lcd.print("Line two");

Two Lines at Once

Print a label on row 0, move the cursor to row 1, then print a value. That gives you a tidy two-line layout.

Center Some Text

To center a word, set the cursor to a higher column so the text starts further from the left edge.

lcd.setCursor(5, 0);

Printing Numbers

lcd.print also accepts numbers, not just text. Pass a variable and the value shows up directly on screen.

lcd.print(temperature);

Watch Leftover Characters

Old text does not vanish on its own. If a new value is shorter, stray old digits can linger behind it.

Pad to Overwrite

Print extra spaces after a short value, or clear that area, so the previous longer text is fully covered.

lcd.print(value);
lcd.print("   ");

Home Position

Calling lcd.home() sends the cursor back to column 0, row 0 without clearing the existing text.

lcd.home();

Quick Check

You want text to appear on the bottom-left of a 16x2 LCD. Which call positions the cursor there?

Recap

You can now place text anywhere with setCursor, remembering column then row from zero, and pad with spaces to clear old characters. ✅

Perguntas Frequentes

A aula “Posicione o cursor e exiba texto” é grátis?

Sim — o texto completo de “Posicione o cursor e exiba texto” é 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 “Posicione o cursor e exiba texto”?

Coloque o texto exatamente nas linhas e colunas desejadas. 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 3 de 4.

Quanto tempo leva a aula “Posicione o cursor e exiba texto”?

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

  1. Conecte um LCD 16x2 (adaptador I2C)
  2. Biblioteca LiquidCrystal_I2C
  3. Posicione o cursor e exiba texto
  4. Painel de sensores ao vivo
← Voltar para Arduino & IoT Academy