You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Shifts out a byte of data one bit at a time. Starts from either the most (i.e. the leftmost) or least (rightmost) significant bit. Each bit is written in turn to a data pin, after which a clock pin is pulsed (taken high, then low) to indicate that the bit is available.
20
+
=== Descrição
21
+
Transfere um byte de dados um bit de cada vez. Começa com ou o bit mais significante (o mais à esquerda) ou o menos significante (mais à direita). Cada bit é escrito em sequência em um pino _data_, logo após o pino _clock_ é pulsado (colocado em HIGH, depois LOW) para indicar que aquele bit está disponível.
22
22
23
-
Note- if you're interfacing with a device that's clocked by rising edges, you'll need to make sure that the clock pin is low before the call to `shiftOut()`, e.g. with a call to `digitalWrite(clockPin, LOW)`.
23
+
Nota - se você está conectando um dispositivo que é sincronizado pela borda de subida do clock, irá precisar fazer com que o pino clock seja low antes de chamar `shiftOut()`, ex. com `digitalWrite(clockPin, LOW)`.
24
24
25
-
This is a software implementation; see also the link:../SPI[SPI library], which provides a hardware implementation that is faster but works only on specific pins.
25
+
Essa é uma implementação por software; O Arduino também provê uma link:../SPI[biblioteca SPI] que faz a implementação em hardware, que é mais rápida, mas apenas funciona em pinos específicos.
26
26
[%hardbreaks]
27
27
28
28
29
29
[float]
30
-
=== Syntax
30
+
=== Sintaxe
31
31
`shiftOut(dataPin, clockPin, bitOrder, value)`
32
32
33
33
34
34
[float]
35
-
=== Parameters
36
-
`dataPin`: the pin on which to output each bit (int)
35
+
=== Parâmetros
36
+
`dataPin`: o pino no qual transferir cada bit (int)
37
37
38
-
`clockPin`: the pin to toggle once the dataPin has been set to the correct value (int)
38
+
`clockPin`: o pino a ser pulsado uma vez que o pino data estiver com o bit a ser trasnferido (int)
39
39
40
-
`bitOrder`: which order to shift out the bits; either MSBFIRST or LSBFIRST.
41
-
(Most Significant Bit First, or, Least Significant Bit First)
40
+
`bitOrder`: em que ordem receber os bits; pode ser *MSBFIRST* ou *LSBFIRST*. Respectivamente, primeiro o bit mais significativo (Most Significant Bit First), ou o primeiro o bit menos significativo (Least Significant Bit First)
42
41
43
-
`value`: the data to shift out. (byte)
42
+
`value`: o valor a ser transferido. (byte)
44
43
45
44
[float]
46
-
=== Returns
47
-
Nothing
45
+
=== Retorna
46
+
Nada
48
47
49
48
--
50
49
// OVERVIEW SECTION ENDS
@@ -57,9 +56,9 @@ Nothing
57
56
--
58
57
59
58
[float]
60
-
=== Example Code
59
+
=== Código de Exemplo
61
60
// Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄
62
-
For accompanying circuit, see the http://arduino.cc/en/Tutorial/ShiftOut[tutorial on controlling a 74HC595 shift register].
61
+
Para o circuito, ver o http://arduino.cc/en/Tutorial/ShiftOut[tutorial sobre o controle de um registrador de deslocamento 74HC595 (Em Inglês)].
63
62
64
63
[source,arduino]
65
64
----
@@ -72,28 +71,31 @@ For accompanying circuit, see the http://arduino.cc/en/Tutorial/ShiftOut[tutoria
//set pins to output because they are addressed in the main loop
82
+
//configura os pinos usados no loop principal como saídas
84
83
pinMode(latchPin, OUTPUT);
85
84
pinMode(clockPin, OUTPUT);
86
85
pinMode(dataPin, OUTPUT);
87
86
}
88
87
89
88
void loop() {
90
-
//count up routine
89
+
//rotina de contagem de 0 até 255
91
90
for (int j = 0; j < 256; j++) {
92
-
//ground latchPin and hold low for as long as you are transmitting
91
+
//coloca e mantém o pino latch em low enquanto ocorre a transmissão
93
92
digitalWrite(latchPin, LOW);
93
+
94
+
//transmite o valor de j, a começar pelo bit menos significativo
94
95
shiftOut(dataPin, clockPin, LSBFIRST, j);
95
-
//return the latch pin high to signal chip that it
96
-
//no longer needs to listen for information
96
+
97
+
//retorna o pino latch para high para sinalizar ao chip
98
+
//que esse não precisa mais esperar por informação
97
99
digitalWrite(latchPin, HIGH);
98
100
delay(1000);
99
101
}
@@ -102,24 +104,24 @@ void loop() {
102
104
[%hardbreaks]
103
105
104
106
[float]
105
-
=== Notes and Warnings
106
-
The dataPin and clockPin must already be configured as outputs by a call to link:../digital-io/pinMode[pinMode()].
107
+
=== Notas e Advertências
108
+
Os pinos data e clock devem ser configurados como saídas com uma chamada de link:../digital-io/pinMode[pinMode()].
107
109
108
-
shiftOut is currently written to output 1 byte (8 bits) so it requires a two step operation to output values larger than 255.
110
+
A função `shiftOut()` atualmente funciona para transferir apenas 1 byte (8 bits) então requer uma operação em dois passos para transferir valores maiores que 255.
0 commit comments