Skip to content

Commit b0c6e04

Browse files
authored
Translated pulseIn() function
1 parent 544eb7a commit b0c6e04

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

Language/Functions/Advanced IO/pulseIn.adoc

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: pulseIn()
33
categories: [ "Functions" ]
4-
subCategories: [ "Advanced I/O" ]
4+
subCategories: [ "Entradas e Saídas Avançadas" ]
55
---
66

77
:source-highlighter: pygments
@@ -17,29 +17,29 @@ subCategories: [ "Advanced I/O" ]
1717
--
1818

1919
[float]
20-
=== Description
21-
Reads a pulse (either HIGH or LOW) on a pin. For example, if *value* is *HIGH*, `pulseIn()` waits for the pin to go *HIGH*, starts timing, then waits for the pin to go *LOW* and stops timing. Returns the length of the pulse in microseconds. Gives up and returns 0 if no pulse starts within a specified time out.
20+
=== Descrição
21+
Captura a duração de um pulso em um pino (que pode ser HIGH ou LOW). Por exemplo, se o valor *HIGH* é passado para a função, a função `pulseIn()` espera o pino ir para o estado *HIGH*, começa a temporizar, então espera o pino ir para o estado *LOW* e para de temporizar. Retorna o tamanho do pulso em microssegundos. Desiste e retorna 0 se não receber nenhum pulso, caso um _timeout_ seja especificado.
2222

23-
The timing of this function has been determined empirically and will probably show errors in longer pulses. Works on pulses from 10 microseconds to 3 minutes in length.
23+
A temporização dessa função foi determinada empiricamente e irá provavelmente mostrar erros em pulsos mais longos. funciona em pulsos de 10 microssegundos a 3 minutes de duração.
2424
[%hardbreaks]
2525

2626

2727
[float]
28-
=== Syntax
29-
`pulseIn(pin, value)`
28+
=== Sintaxe
29+
`pulseIn(pino, valor)`
3030

31-
`pulseIn(pin, value, timeout)`
31+
`pulseIn(pino, valor, timeout)`
3232

3333
[float]
34-
=== Parameters
35-
`pin`: the number of the pin on which you want to read the pulse. (int)
34+
=== Parâmetros
35+
`pino`: o número do pino no qual se quer capturar a duração de um pulso. (int)
3636

37-
`value`: type of pulse to read: either link:../../../variables/constants/constants/[HIGH] or link:../../../variables/constants/constants/[LOW]. (int)
37+
`valor`: tipo de pulso a ser lido: pode ser link:../../../variables/constants/constants/[HIGH] ou link:../../../variables/constants/constants/[LOW]. (int)
3838

39-
`timeout` (optional): the number of microseconds to wait for the pulse to start; default is one second (unsigned long)
39+
`timeout` (opcional): o numero de microssegundos a se esperar pelo começo do pulso; o padrão é um segundo (unsigned long)
4040
[float]
41-
=== Returns
42-
the length of the pulse (in microseconds) or 0 if no pulse started before the timeout (unsigned long)
41+
=== Retorna
42+
a duração do pulso (em microssegundos) ou 0 se nenhum pulso começar antes de se esgotar o timeout (unsigned long)
4343

4444
--
4545
// OVERVIEW SECTION ENDS
@@ -52,23 +52,23 @@ the length of the pulse (in microseconds) or 0 if no pulse started before the ti
5252
--
5353

5454
[float]
55-
=== Example Code
55+
=== Código de Exemplo
5656
// Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄
57-
The example calculated the time duration of a pulse on pin 7.
57+
O exemplo abaixo calcula a duração de um pulso no pino 7.
5858

5959
[source,arduino]
6060
----
61-
int pin = 7;
62-
unsigned long duration;
61+
int pin = 7; //pino para a entrada do pulso
62+
unsigned long duration; //variável para guardar a duração do pulso
6363
6464
void setup()
6565
{
66-
pinMode(pin, INPUT);
66+
pinMode(pin, INPUT); // pino 7 como entrada
6767
}
6868
6969
void loop()
7070
{
71-
duration = pulseIn(pin, HIGH);
71+
duration = pulseIn(pin, HIGH); //mede a duração de um pulso HIGH no pino 7
7272
}
7373
----
7474
[%hardbreaks]

0 commit comments

Comments
 (0)