Skip to content

Commit ac89786

Browse files
authored
Merge pull request #2702 from rnowling/patch-3
Fix code indentation in library style guide
2 parents e718f9f + 385984a commit ac89786

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

content/learn/08.contributions/01.arduino-library-style-guide/arduino-library-style-guide.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ void printArray(char[] array);
4949
Though there are some libraries where we pass pointers by using structures like const chars, avoid anything that requires the user to pass them. For example,rather than:
5050

5151
```arduino
52-
foo.readAccel(&x, &y, &z);
52+
foo.readAccel(&x, &y, &z);
5353
```
5454

5555
use something like this:
5656

5757
```arduino
58-
xAxis = adxl.readX();
59-
yAxis = adxl.readY();
60-
zAxis = adxl.readZ();
58+
xAxis = adxl.readX();
59+
yAxis = adxl.readY();
60+
zAxis = adxl.readZ();
6161
```
6262

6363
When using serial communication, allow the user to specify any `Stream` object, rather than hard-coding `Serial`. This will make your library compatible with all serial ports on boards with multiple (e.g., Mega), and can also use alternate interfaces like SoftwareSerial. The Stream object can be passed to your library's constructor or to a `begin()` function (as a reference, not a pointer). See [Firmata 2.3](https://www.arduino.cc/reference/en/libraries/firmata/) or [XBee 0.4](https://github.com/andrewrapp/xbee-arduino) for examples of each approach.
@@ -71,4 +71,5 @@ Here are a few libraries that are exemplary from Adafruit®. She breaks the func
7171

7272
This does a nice job of abstracting from the Wire (I2C) library: https://github.com/adafruit/RTClib
7373

74-
The text of the Arduino reference is licensed under a [Creative Commons Attribution-ShareAlike 3.0 License](http://creativecommons.org/licenses/by-sa/3.0/). Code samples in the reference are released into the public domain.
74+
75+
The text of the Arduino reference is licensed under a [Creative Commons Attribution-ShareAlike 3.0 License](http://creativecommons.org/licenses/by-sa/3.0/). Code samples in the reference are released into the public domain.

0 commit comments

Comments
 (0)