From b3f1271f45d90eaa14aef93ed85b7f8997613dd9 Mon Sep 17 00:00:00 2001 From: per1234 Date: Thu, 21 Feb 2019 22:31:43 -0800 Subject: [PATCH] Fix formatting of example code Fix formatting issues which were not covered by the auto format. Fix formatting issues in AsciiDoc_Template-Dictionary.adoc, which I accidentally skipped during the auto format. --- .../AsciiDoc_Dictionary/AsciiDoc_Template-Dictionary.adoc | 4 ++-- Language/Structure/Control Structure/break.adoc | 2 +- Language/Variables/Utilities/PROGMEM.adoc | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/AsciiDoc_sample/AsciiDoc_Dictionary/AsciiDoc_Template-Dictionary.adoc b/AsciiDoc_sample/AsciiDoc_Dictionary/AsciiDoc_Template-Dictionary.adoc index d24aa95c7..d17ddbb10 100644 --- a/AsciiDoc_sample/AsciiDoc_Dictionary/AsciiDoc_Template-Dictionary.adoc +++ b/AsciiDoc_sample/AsciiDoc_Dictionary/AsciiDoc_Template-Dictionary.adoc @@ -105,8 +105,8 @@ This is `code` in a sentence + This can be a lot more code [source,arduino] ---- -for (int 1; i<=99; i++) { - Serial.println('We want more code!'); +for (int i = 0; i <= 99; i++) { + Serial.println('We want more code!'); } ---- [%hardbreaks] diff --git a/Language/Structure/Control Structure/break.adoc b/Language/Structure/Control Structure/break.adoc index 40f98e3cf..8d6a33087 100644 --- a/Language/Structure/Control Structure/break.adoc +++ b/Language/Structure/Control Structure/break.adoc @@ -36,7 +36,7 @@ In the following code, the control exits the `for` loop when the sensor value ex [source,arduino] ---- int threshold = 40; -for (int x = 0; x < 255; x ++) { +for (int x = 0; x < 255; x++) { analogWrite(PWMpin, x); sens = analogRead(sensorPin); if (sens > threshold) { // bail out on sensor detect diff --git a/Language/Variables/Utilities/PROGMEM.adoc b/Language/Variables/Utilities/PROGMEM.adoc index 92dc99c04..1d5d639b3 100644 --- a/Language/Variables/Utilities/PROGMEM.adoc +++ b/Language/Variables/Utilities/PROGMEM.adoc @@ -65,10 +65,10 @@ The following code fragments illustrate how to read and write unsigned chars (by [source,arduino] ---- // save some unsigned ints -const PROGMEM uint16_t charSet[] = { 65000, 32796, 16843, 10, 11234}; +const PROGMEM uint16_t charSet[] = { 65000, 32796, 16843, 10, 11234}; // save some chars -const char signMessage[] PROGMEM = {"I AM PREDATOR, UNSEEN COMBATANT. CREATED BY THE UNITED STATES DEPART"}; +const char signMessage[] PROGMEM = {"I AM PREDATOR, UNSEEN COMBATANT. CREATED BY THE UNITED STATES DEPART"}; unsigned int displayInt; char myChar; @@ -88,7 +88,7 @@ void setup() { // read back a char for (byte k = 0; k < strlen_P(signMessage); k++) { - myChar = pgm_read_byte_near(signMessage + k); + myChar = pgm_read_byte_near(signMessage + k); Serial.print(myChar); }