Skip to content

Commit f3eced4

Browse files
authored
Merge PR #529 "Use consistent formatting of all code" from per1234
Use consistent formatting of all code
2 parents 8f7f3dd + 1ec8dbe commit f3eced4

File tree

118 files changed

+570
-682
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+570
-682
lines changed

AsciiDoc_sample/Reference_Terms/AsciiDoc_Template-Single_Entity.adoc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,11 @@ int ledPin = 9; // LED connected to digital pin 9
7676
int analogPin = 3; // potentiometer connected to analog pin 3
7777
int val = 0; // variable to store the read value
7878
79-
void setup()
80-
{
79+
void setup() {
8180
pinMode(ledPin, OUTPUT); // sets the pin as output
8281
}
8382
84-
void loop()
85-
{
83+
void loop() {
8684
val = analogRead(analogPin); // read the input pin
8785
analogWrite(ledPin, val / 4); // analogRead values go from 0 to 1023, analogWrite values from 0 to 255
8886
}

Language/Functions/Advanced IO/pulseIn.adoc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,12 @@ The example prints the time duration of a pulse on pin 7.
6060
int pin = 7;
6161
unsigned long duration;
6262
63-
void setup()
64-
{
63+
void setup() {
6564
Serial.begin(9600);
6665
pinMode(pin, INPUT);
6766
}
6867
69-
void loop()
70-
{
68+
void loop() {
7169
duration = pulseIn(pin, HIGH);
7270
Serial.println(duration);
7371
}

Language/Functions/Analog IO/analogRead.adoc

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,17 @@ The code reads the voltage on analogPin and displays it.
6565

6666
[source,arduino]
6767
----
68-
int analogPin = A3; // potentiometer wiper (middle terminal) connected to analog pin 3
69-
// outside leads to ground and +5V
70-
int val = 0; // variable to store the value read
68+
int analogPin = A3; // potentiometer wiper (middle terminal) connected to analog pin 3
69+
// outside leads to ground and +5V
70+
int val = 0; // variable to store the value read
7171
72-
void setup()
73-
{
74-
Serial.begin(9600); // setup serial
72+
void setup() {
73+
Serial.begin(9600); // setup serial
7574
}
7675
77-
void loop()
78-
{
79-
val = analogRead(analogPin); // read the input pin
80-
Serial.println(val); // debug value
76+
void loop() {
77+
val = analogRead(analogPin); // read the input pin
78+
Serial.println(val); // debug value
8179
}
8280
----
8381
[%hardbreaks]

Language/Functions/Analog IO/analogWrite.adoc

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,13 @@ int ledPin = 9; // LED connected to digital pin 9
6262
int analogPin = 3; // potentiometer connected to analog pin 3
6363
int val = 0; // variable to store the read value
6464
65-
void setup()
66-
{
67-
pinMode(ledPin, OUTPUT); // sets the pin as output
65+
void setup() {
66+
pinMode(ledPin, OUTPUT); // sets the pin as output
6867
}
6968
70-
void loop()
71-
{
72-
val = analogRead(analogPin); // read the input pin
73-
analogWrite(ledPin, val / 4); // analogRead values go from 0 to 1023, analogWrite values from 0 to 255
69+
void loop() {
70+
val = analogRead(analogPin); // read the input pin
71+
analogWrite(ledPin, val / 4); // analogRead values go from 0 to 1023, analogWrite values from 0 to 255
7472
}
7573
----
7674
[%hardbreaks]

Language/Functions/Characters/isAlpha.adoc

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,12 @@ isAlpha(thisChar)
5050

5151
[source,arduino]
5252
----
53-
if (isAlpha(myChar)) // tests if myChar is a letter
54-
{
55-
Serial.println("The character is a letter");
53+
if (isAlpha(myChar)) { // tests if myChar is a letter
54+
Serial.println("The character is a letter");
5655
}
57-
else
58-
{
59-
Serial.println("The character is not a letter");
56+
else {
57+
Serial.println("The character is not a letter");
6058
}
61-
6259
----
6360

6461
--

Language/Functions/Characters/isAlphaNumeric.adoc

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,12 @@ isAlphaNumeric(thisChar)
5050

5151
[source,arduino]
5252
----
53-
if (isAlphaNumeric(myChar)) // tests if myChar isa letter or a number
54-
{
55-
Serial.println("The character is alphanumeric");
53+
if (isAlphaNumeric(myChar)) { // tests if myChar isa letter or a number
54+
Serial.println("The character is alphanumeric");
5655
}
57-
else
58-
{
59-
Serial.println("The character is not alphanumeric");
56+
else {
57+
Serial.println("The character is not alphanumeric");
6058
}
61-
6259
----
6360

6461
--

Language/Functions/Characters/isAscii.adoc

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,12 @@ isAscii(thisChar)
5050

5151
[source,arduino]
5252
----
53-
if (isAscii(myChar)) // tests if myChar is an Ascii character
54-
{
55-
Serial.println("The character is Ascii");
53+
if (isAscii(myChar)) { // tests if myChar is an Ascii character
54+
Serial.println("The character is Ascii");
5655
}
57-
else
58-
{
59-
Serial.println("The character is not Ascii");
56+
else {
57+
Serial.println("The character is not Ascii");
6058
}
61-
6259
----
6360

6461
--

Language/Functions/Characters/isControl.adoc

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,12 @@ isControl(thisChar)
5050

5151
[source,arduino]
5252
----
53-
if (isControl(myChar)) // tests if myChar is a control character
54-
{
55-
Serial.println("The character is a control character");
53+
if (isControl(myChar)) { // tests if myChar is a control character
54+
Serial.println("The character is a control character");
5655
}
57-
else
58-
{
59-
Serial.println("The character is not a control character");
56+
else {
57+
Serial.println("The character is not a control character");
6058
}
61-
6259
----
6360

6461
--

Language/Functions/Characters/isDigit.adoc

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,12 @@ isDigit(thisChar)
5050

5151
[source,arduino]
5252
----
53-
if (isDigit(myChar)) // tests if myChar is a digit
54-
{
55-
Serial.println("The character is a number");
53+
if (isDigit(myChar)) { // tests if myChar is a digit
54+
Serial.println("The character is a number");
5655
}
57-
else
58-
{
59-
Serial.println("The character is not a number");
56+
else {
57+
Serial.println("The character is not a number");
6058
}
61-
6259
----
6360

6461
--

Language/Functions/Characters/isGraph.adoc

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,12 @@ isGraph(thisChar)
5050

5151
[source,arduino]
5252
----
53-
if (isGraph(myChar)) // tests if myChar is a printable character but not a blank space.
54-
{
55-
Serial.println("The character is printable");
53+
if (isGraph(myChar)) { // tests if myChar is a printable character but not a blank space.
54+
Serial.println("The character is printable");
5655
}
57-
else
58-
{
59-
Serial.println("The character is not printable");
56+
else {
57+
Serial.println("The character is not printable");
6058
}
61-
6259
----
6360

6461
--

0 commit comments

Comments
 (0)