Skip to content

Commit 0072e7d

Browse files
authored
Translated bool data type
This solves issue #300
1 parent 9bd0530 commit 0072e7d

File tree

1 file changed

+15
-23
lines changed

1 file changed

+15
-23
lines changed
Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,55 @@
11
---
22
title: bool
33
categories: [ "Variables" ]
4-
subCategories: [ "Data Types" ]
4+
subCategories: [ "Tipos de Dados" ]
55
---
66

7-
8-
9-
10-
117
= bool
128

13-
149
// OVERVIEW SECTION STARTS
1510
[#overview]
1611
--
1712

1813
[float]
19-
=== Description
20-
A `bool` holds one of two values, `true` or `false`. (Each `bool` variable occupies one byte of memory.)
21-
14+
=== Descrição
15+
O tipo `bool` pode armazenar dois valores: `true` or `false`. (Cada variável `bool` ocupa um byte na memória.)
2216

2317
[%hardbreaks]
2418

2519
--
2620
// OVERVIEW SECTION ENDS
2721

2822

29-
30-
3123
// HOW TO USE SECTION STARTS
3224
[#howtouse]
3325
--
3426

3527
[float]
36-
=== Example Code
28+
=== Código de Exemplo
3729
// Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄
38-
This code shows how to use the `bool` datatype.
30+
O código abaixo mostra como usar o tipo de dado `bool`.
3931

4032
[source,arduino]
4133
----
42-
int LEDpin = 5; // LED on pin 5
43-
int switchPin = 13; // momentary switch on 13, other side connected to ground
34+
int LEDpin = 5; // LED no pino digital 5
35+
int switchPin = 13; // botão conectado ao pino 13 e o outro terminal ao ground
4436
45-
bool running = false;
37+
bool running = false; //variável do tipo boolean
4638
4739
void setup()
4840
{
4941
pinMode(LEDpin, OUTPUT);
5042
pinMode(switchPin, INPUT);
51-
digitalWrite(switchPin, HIGH); // turn on pullup resistor
43+
digitalWrite(switchPin, HIGH); // ativa o resistor pull-up
5244
}
5345
5446
void loop()
5547
{
5648
if (digitalRead(switchPin) == LOW)
57-
{ // switch is pressed - pullup keeps pin high normally
58-
delay(100); // delay to debounce switch
59-
running = !running; // toggle running variable
60-
digitalWrite(LEDpin, running); // indicate via LED
49+
{ // botão foi pressionado, o pull-up mantém o pino em HIGH internamente
50+
delay(100); // delay para fazer o debounce no botão
51+
running = !running; // troca o valor da variável running
52+
digitalWrite(LEDpin, running); // indica via LED
6153
}
6254
}
6355
----
@@ -71,10 +63,10 @@ void loop()
7163
--
7264

7365
[float]
74-
=== See also
66+
=== Ver Também
7567

7668
[role="language"]
77-
* #LANGUAGE# link:../../../variables/constants/constants[constants]
69+
#LINGUAGEM# link:../../../variables/constants/constants[constantes] +
7870

7971
--
8072
// SEE ALSO SECTION ENDS

0 commit comments

Comments
 (0)