Skip to content
This repository was archived by the owner on Sep 23, 2021. It is now read-only.

Commit 833623d

Browse files
author
Federico Fissore
committed
Examples: mass code format. See example_formatter.conf
1 parent dd1af13 commit 833623d

File tree

7 files changed

+20
-24
lines changed

7 files changed

+20
-24
lines changed

examples/Beginners/EsploraAccelerometer/EsploraAccelerometer.ino

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@
1414

1515
#include <Esplora.h>
1616

17-
void setup()
18-
{
17+
void setup() {
1918
Serial.begin(9600); // initialize serial communications with your computer
2019
}
2120

22-
void loop()
23-
{
21+
void loop() {
2422
int xAxis = Esplora.readAccelerometer(X_AXIS); // read the X axis
2523
int yAxis = Esplora.readAccelerometer(Y_AXIS); // read the Y axis
2624
int zAxis = Esplora.readAccelerometer(Z_AXIS); // read the Z axis

examples/Beginners/EsploraJoystickMouse/EsploraJoystickMouse.ino

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,20 @@
1919
by Tom Igoe
2020
Updated 8 March 2014
2121
by Scott Fitzgerald
22-
22+
2323
http://www.arduino.cc/en/Reference/EsploraReadJoystickSwitch
2424
2525
This example is in the public domain.
2626
*/
2727

2828
#include <Esplora.h>
2929

30-
void setup()
31-
{
30+
void setup() {
3231
Serial.begin(9600); // initialize serial communication with your computer
3332
Mouse.begin(); // take control of the mouse
3433
}
3534

36-
void loop()
37-
{
35+
void loop() {
3836
int xValue = Esplora.readJoystickX(); // read the joystick's X position
3937
int yValue = Esplora.readJoystickY(); // read the joystick's Y position
4038
int button = Esplora.readJoystickSwitch(); // read the joystick pushbutton
@@ -52,7 +50,7 @@ void loop()
5250
if (button == 0) { // if the joystick button is pressed
5351
Mouse.press(); // send a mouse click
5452
} else {
55-
Mouse.release(); // if it's not pressed, release the mouse button
53+
Mouse.release(); // if it's not pressed, release the mouse button
5654
}
5755

5856
delay(10); // a short delay before moving again

examples/Beginners/EsploraMusic/EsploraMusic.ino

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ void loop() {
4545
byte thisNote = map(slider, 0, 1023, 0, 13);
4646
// play the note corresponding to the slider's position:
4747
Esplora.tone(note[thisNote]);
48-
}
49-
else {
48+
} else {
5049
// if the button isn't pressed, turn the note off:
5150
Esplora.noTone();
5251
}

examples/Beginners/EsploraTemperatureSensor/EsploraTemperatureSensor.ino

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@
1111
*/
1212
#include <Esplora.h>
1313

14-
void setup()
15-
{
14+
void setup() {
1615
Serial.begin(9600); // initialize serial communications with your computer
1716
}
1817

19-
void loop()
20-
{
18+
void loop() {
2119
// read the temperature sensor in Celsius, then Fahrenheit:
2220
int celsius = Esplora.readTemperature(DEGREES_C);
2321
int fahrenheit = Esplora.readTemperature(DEGREES_F);

examples/Experts/EsploraKart/EsploraKart.ino

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ void loop() {
103103
*/
104104
if (newState == PRESSED) {
105105
Keyboard.press(keystrokes[thisButton]);
106-
}
107-
else if (newState == RELEASED) {
106+
} else if (newState == RELEASED) {
108107
Keyboard.release(keystrokes[thisButton]);
109108
}
110109
}

examples/Experts/EsploraRemote/EsploraRemote.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ void setup() {
3737
}
3838

3939
void loop() {
40-
if (Serial.available())
40+
if (Serial.available()) {
4141
parseCommand();
42+
}
4243
}
4344

4445
/*

examples/Experts/EsploraTable/EsploraTable.ino

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,17 +114,19 @@ void loop() {
114114

115115
// let the RGB led blink green once per second, for 200ms.
116116
unsigned int ms = millis() % 1000;
117-
if (ms < 200)
117+
if (ms < 200) {
118118
Esplora.writeGreen(50);
119-
else
119+
} else {
120120
Esplora.writeGreen(0);
121+
}
121122

122123
Esplora.writeBlue(0);
123-
}
124-
else
124+
} else
125125
// while not active, keep a reassuring blue color coming
126126
// from the Esplora...
127+
{
127128
Esplora.writeBlue(20);
129+
}
128130

129131
}
130132

@@ -203,8 +205,9 @@ void checkSwitchPress() {
203205
if (startBtn != lastStartBtn) {
204206
if (startBtn == HIGH) { // button released
205207
active = !active;
206-
if (active)
208+
if (active) {
207209
justActivated = true;
210+
}
208211
}
209212

210213
lastStartBtn = startBtn;

0 commit comments

Comments
 (0)