From b3da2244f355aea485f3ab4e6bd6c8055222bd78 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 7 Sep 2020 03:01:11 -0700 Subject: [PATCH 01/59] Revert "Provide GitHub token to action in Compile Examples CI workflow" This reverts commit 50228bf858cb4d68978d72df1e9ee02e6e06dba8. The GitHub access token was only required by the CI workflow while the repository was private. Now that it's been made public, there is no need for it. --- .github/workflows/compile-examples.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 3e2e142..ddd0676 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -201,5 +201,3 @@ jobs: ${{ matrix.starter-kit-sketch-paths }} ${{ matrix.tone-sketch-paths }} ${{ matrix.pulsein-sketch-paths }} - # This input can be removed once the repository is made public - github-token: ${{ secrets.GITHUB_TOKEN }} From 01de945d8626037b261d85187381a9916845626a Mon Sep 17 00:00:00 2001 From: "Zachary J. Fields" Date: Fri, 7 Apr 2017 03:41:21 -0700 Subject: [PATCH 02/59] Update 04.Analog/Calibrate.ino Calibrate generated values beyond the from range of the map function and the behavior did not seem to match the spirit of the comments. --- examples/03.Analog/Calibration/Calibration.ino | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/03.Analog/Calibration/Calibration.ino b/examples/03.Analog/Calibration/Calibration.ino index 5c0fc6d..88b16a4 100644 --- a/examples/03.Analog/Calibration/Calibration.ino +++ b/examples/03.Analog/Calibration/Calibration.ino @@ -18,6 +18,8 @@ by David A Mellis modified 30 Aug 2011 by Tom Igoe + modified 07 Apr 2017 + by Zachary J. Fields This example code is in the public domain. @@ -62,12 +64,12 @@ void loop() { // read the sensor: sensorValue = analogRead(sensorPin); + // in case the sensor value is outside the range seen during calibration + sensorValue = constrain(sensorValue, sensorMin, sensorMax); + // apply the calibration to the sensor reading sensorValue = map(sensorValue, sensorMin, sensorMax, 0, 255); - // in case the sensor value is outside the range seen during calibration - sensorValue = constrain(sensorValue, 0, 255); - // fade the LED using the calibrated value: analogWrite(ledPin, sensorValue); } From 4421ef8804230fcdad9b587e95bb253913b6784c Mon Sep 17 00:00:00 2001 From: per1234 Date: Thu, 15 Oct 2020 04:43:01 -0700 Subject: [PATCH 03/59] Update FQBN for Portenta H7 in Compile Examples CI workflow The beta phase arduino-beta:mbed boards platform of the Portenta H7 has been deprecated, which will cause the compilation check CI for this board to fail when the old FQBN is used. --- .github/workflows/compile-examples.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index ddd0676..c3f8074 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -114,8 +114,7 @@ jobs: starter-kit: false tone: true pulsein: true - # Change this to arduino:mbed:envie_m7 once there is a production release of the Arduino Mbed OS Boards platform - - fqbn: arduino-beta:mbed:envie_m7 + - fqbn: arduino:mbed:envie_m7 usb: false serial1: true starter-kit: false From 9e449539b5791bc40de7c22c49c8f566d5aacbaf Mon Sep 17 00:00:00 2001 From: Kristoffer Engdahl Date: Mon, 16 Nov 2020 14:28:46 +0100 Subject: [PATCH 04/59] Update AnalogReadSerial.ino Fixed faulty link --- examples/01.Basics/AnalogReadSerial/AnalogReadSerial.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/01.Basics/AnalogReadSerial/AnalogReadSerial.ino b/examples/01.Basics/AnalogReadSerial/AnalogReadSerial.ino index 789785d..10e67ec 100644 --- a/examples/01.Basics/AnalogReadSerial/AnalogReadSerial.ino +++ b/examples/01.Basics/AnalogReadSerial/AnalogReadSerial.ino @@ -7,7 +7,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/AnalogReadSerial + https://www.arduino.cc/en/Tutorial/BuiltInExamples/AnalogReadSerial */ // the setup routine runs once when you press reset: From 5d5e15b41a4300ded9de655497b973e2a365b32c Mon Sep 17 00:00:00 2001 From: per1234 Date: Wed, 18 Nov 2020 05:39:11 -0800 Subject: [PATCH 05/59] Restrict ArduinoISP name collision fix to ArduinoCore-API 1.0.1 ArduinoCore-API 1.0.1 declares a SPISettings class, but ArduinoCore-API 1.0.0 and 1.1.0 don't do this, so the previous preprocessor conditional that was added to fix the ArduinoCore-API sketch for platforms using ArduinoCore-API 1.0.1 actually breaks it for platforms using previous or later versions. --- examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino b/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino index 43a91d3..52d8469 100644 --- a/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino +++ b/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino @@ -164,7 +164,7 @@ void pulse(int pin, int times); #define SPI_MODE0 0x00 -#if !defined(ARDUINO_API_VERSION) // A SPISettings class is declared by ArduinoCore-API +#if !defined(ARDUINO_API_VERSION) || ARDUINO_API_VERSION != 10001 // A SPISettings class is declared by ArduinoCore-API 1.0.1 class SPISettings { public: // clock is in Hz From c8fae22ad9956ddab0e8ddb2b8d29e7e92ecbd5e Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 29 Nov 2020 09:44:30 -0800 Subject: [PATCH 06/59] Add current limiting resistors for LEDs to circuit description comments I followed the existing precedent set in the "WhileStatementConditional" example for the text. 220 ohm is the value used in the tutorials for the examples, as well as being what is provided in the Starter Kit. --- examples/02.Digital/Button/Button.ino | 2 +- examples/02.Digital/Debounce/Debounce.ino | 2 +- .../StateChangeDetection/StateChangeDetection.ino | 4 ++-- examples/03.Analog/AnalogInOutSerial/AnalogInOutSerial.ino | 2 +- examples/03.Analog/AnalogInput/AnalogInput.ino | 2 +- examples/03.Analog/Calibration/Calibration.ino | 2 +- examples/03.Analog/Fading/Fading.ino | 2 +- examples/04.Communication/Dimmer/Dimmer.ino | 2 +- examples/04.Communication/PhysicalPixel/PhysicalPixel.ino | 2 +- .../04.Communication/ReadASCIIString/ReadASCIIString.ino | 6 +++--- .../IfStatementConditional/IfStatementConditional.ino | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/examples/02.Digital/Button/Button.ino b/examples/02.Digital/Button/Button.ino index 06cb351..e2e9914 100644 --- a/examples/02.Digital/Button/Button.ino +++ b/examples/02.Digital/Button/Button.ino @@ -5,7 +5,7 @@ when pressing a pushbutton attached to pin 2. The circuit: - - LED attached from pin 13 to ground + - LED attached from pin 13 to ground through 220 ohm resistor - pushbutton attached to pin 2 from +5V - 10K resistor attached to pin 2 from ground diff --git a/examples/02.Digital/Debounce/Debounce.ino b/examples/02.Digital/Debounce/Debounce.ino index d5d48c9..a550111 100644 --- a/examples/02.Digital/Debounce/Debounce.ino +++ b/examples/02.Digital/Debounce/Debounce.ino @@ -6,7 +6,7 @@ minimum delay between toggles to debounce the circuit (i.e. to ignore noise). The circuit: - - LED attached from pin 13 to ground + - LED attached from pin 13 to ground through 220 ohm resistor - pushbutton attached from pin 2 to +5V - 10 kilohm resistor attached from pin 2 to ground diff --git a/examples/02.Digital/StateChangeDetection/StateChangeDetection.ino b/examples/02.Digital/StateChangeDetection/StateChangeDetection.ino index a5ba8da..66d7098 100644 --- a/examples/02.Digital/StateChangeDetection/StateChangeDetection.ino +++ b/examples/02.Digital/StateChangeDetection/StateChangeDetection.ino @@ -12,8 +12,8 @@ The circuit: - pushbutton attached to pin 2 from +5V - 10 kilohm resistor attached to pin 2 from ground - - LED attached from pin 13 to ground (or use the built-in LED on most - Arduino boards) + - LED attached from pin 13 to ground through 220 ohm resistor (or use the + built-in LED on most Arduino boards) created 27 Sep 2005 modified 30 Aug 2011 diff --git a/examples/03.Analog/AnalogInOutSerial/AnalogInOutSerial.ino b/examples/03.Analog/AnalogInOutSerial/AnalogInOutSerial.ino index 6675a8c..afb43ca 100644 --- a/examples/03.Analog/AnalogInOutSerial/AnalogInOutSerial.ino +++ b/examples/03.Analog/AnalogInOutSerial/AnalogInOutSerial.ino @@ -9,7 +9,7 @@ - potentiometer connected to analog pin 0. Center pin of the potentiometer goes to the analog pin. side pins of the potentiometer go to +5V and ground - - LED connected from digital pin 9 to ground + - LED connected from digital pin 9 to ground through 220 ohm resistor created 29 Dec. 2008 modified 9 Apr 2012 diff --git a/examples/03.Analog/AnalogInput/AnalogInput.ino b/examples/03.Analog/AnalogInput/AnalogInput.ino index 13e7b52..96e9d0e 100644 --- a/examples/03.Analog/AnalogInput/AnalogInput.ino +++ b/examples/03.Analog/AnalogInput/AnalogInput.ino @@ -12,7 +12,7 @@ one side pin (either one) to ground the other side pin to +5V - LED - anode (long leg) attached to digital output 13 + anode (long leg) attached to digital output 13 through 220 ohm resistor cathode (short leg) attached to ground - Note: because most Arduinos have a built-in LED attached to pin 13 on the diff --git a/examples/03.Analog/Calibration/Calibration.ino b/examples/03.Analog/Calibration/Calibration.ino index 88b16a4..d75f45a 100644 --- a/examples/03.Analog/Calibration/Calibration.ino +++ b/examples/03.Analog/Calibration/Calibration.ino @@ -12,7 +12,7 @@ The circuit: - analog sensor (potentiometer will do) attached to analog input 0 - - LED attached from digital pin 9 to ground + - LED attached from digital pin 9 to ground through 220 ohm resistor created 29 Oct 2008 by David A Mellis diff --git a/examples/03.Analog/Fading/Fading.ino b/examples/03.Analog/Fading/Fading.ino index 1612b8b..ed76e6f 100644 --- a/examples/03.Analog/Fading/Fading.ino +++ b/examples/03.Analog/Fading/Fading.ino @@ -4,7 +4,7 @@ This example shows how to fade an LED using the analogWrite() function. The circuit: - - LED attached from digital pin 9 to ground. + - LED attached from digital pin 9 to ground through 220 ohm resistor. created 1 Nov 2008 by David A. Mellis diff --git a/examples/04.Communication/Dimmer/Dimmer.ino b/examples/04.Communication/Dimmer/Dimmer.ino index 39be765..010b41a 100644 --- a/examples/04.Communication/Dimmer/Dimmer.ino +++ b/examples/04.Communication/Dimmer/Dimmer.ino @@ -7,7 +7,7 @@ set the brightness of the LED. The circuit: - - LED attached from digital pin 9 to ground. + - LED attached from digital pin 9 to ground through 220 ohm resistor. - Serial connection to Processing, Max/MSP, or another serial application created 2006 diff --git a/examples/04.Communication/PhysicalPixel/PhysicalPixel.ino b/examples/04.Communication/PhysicalPixel/PhysicalPixel.ino index cf35cd2..b08188b 100644 --- a/examples/04.Communication/PhysicalPixel/PhysicalPixel.ino +++ b/examples/04.Communication/PhysicalPixel/PhysicalPixel.ino @@ -9,7 +9,7 @@ Processing (see code below), Flash (via a serial-net proxy), PD, or Max/MSP. The circuit: - - LED connected from digital pin 13 to ground + - LED connected from digital pin 13 to ground through 220 ohm resistor created 2006 by David A. Mellis diff --git a/examples/04.Communication/ReadASCIIString/ReadASCIIString.ino b/examples/04.Communication/ReadASCIIString/ReadASCIIString.ino index ab26c28..e49a989 100644 --- a/examples/04.Communication/ReadASCIIString/ReadASCIIString.ino +++ b/examples/04.Communication/ReadASCIIString/ReadASCIIString.ino @@ -6,9 +6,9 @@ It parses them into ints, and uses those to fade an RGB LED. Circuit: Common-Cathode RGB LED wired like so: - - red anode: digital pin 3 - - green anode: digital pin 5 - - blue anode: digital pin 6 + - red anode: digital pin 3 through 220 ohm resistor + - green anode: digital pin 5 through 220 ohm resistor + - blue anode: digital pin 6 through 220 ohm resistor - cathode: GND created 13 Apr 2012 diff --git a/examples/05.Control/IfStatementConditional/IfStatementConditional.ino b/examples/05.Control/IfStatementConditional/IfStatementConditional.ino index 4dd4090..95b6910 100644 --- a/examples/05.Control/IfStatementConditional/IfStatementConditional.ino +++ b/examples/05.Control/IfStatementConditional/IfStatementConditional.ino @@ -10,7 +10,7 @@ - potentiometer Center pin of the potentiometer goes to analog pin 0. Side pins of the potentiometer go to +5V and ground. - - LED connected from digital pin 13 to ground + - LED connected from digital pin 13 to ground through 220 ohm resistor - Note: On most Arduino boards, there is already an LED on the board connected to pin 13, so you don't need any extra components for this example. From 972f6e53aa12b4a5352bbe77e2f45491b65c1649 Mon Sep 17 00:00:00 2001 From: per1234 Date: Thu, 25 Mar 2021 18:36:21 -0700 Subject: [PATCH 07/59] Update all URLs in example comments Some of the URLs were broken. Almost all of the URLs had changed, but were still working due to redirects. However, these redirects might stop working at some time in the future (as happened during the last round of website reorganization) so it's safest to point them to the final location. --- examples/01.Basics/Blink/Blink.ino | 2 +- examples/01.Basics/DigitalReadSerial/DigitalReadSerial.ino | 2 +- examples/01.Basics/Fade/Fade.ino | 2 +- examples/01.Basics/ReadAnalogVoltage/ReadAnalogVoltage.ino | 2 +- examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino | 2 +- examples/02.Digital/Button/Button.ino | 2 +- examples/02.Digital/Debounce/Debounce.ino | 2 +- .../02.Digital/DigitalInputPullup/DigitalInputPullup.ino | 2 +- .../StateChangeDetection/StateChangeDetection.ino | 2 +- examples/02.Digital/toneKeyboard/toneKeyboard.ino | 2 +- examples/02.Digital/toneMelody/toneMelody.ino | 2 +- examples/02.Digital/toneMultiple/toneMultiple.ino | 2 +- examples/02.Digital/tonePitchFollower/tonePitchFollower.ino | 2 +- examples/03.Analog/AnalogInOutSerial/AnalogInOutSerial.ino | 2 +- examples/03.Analog/AnalogInput/AnalogInput.ino | 2 +- examples/03.Analog/AnalogWriteMega/AnalogWriteMega.ino | 2 +- examples/03.Analog/Calibration/Calibration.ino | 2 +- examples/03.Analog/Fading/Fading.ino | 2 +- examples/03.Analog/Smoothing/Smoothing.ino | 2 +- examples/04.Communication/ASCIITable/ASCIITable.ino | 2 +- examples/04.Communication/Dimmer/Dimmer.ino | 2 +- examples/04.Communication/Graph/Graph.ino | 2 +- examples/04.Communication/Midi/Midi.ino | 2 +- examples/04.Communication/PhysicalPixel/PhysicalPixel.ino | 2 +- .../SerialCallResponse/SerialCallResponse.ino | 2 +- .../SerialCallResponseASCII/SerialCallResponseASCII.ino | 2 +- examples/04.Communication/SerialEvent/SerialEvent.ino | 2 +- .../VirtualColorMixer/VirtualColorMixer.ino | 2 +- examples/05.Control/Arrays/Arrays.ino | 2 +- examples/05.Control/ForLoopIteration/ForLoopIteration.ino | 2 +- .../IfStatementConditional/IfStatementConditional.ino | 2 +- .../WhileStatementConditional/WhileStatementConditional.ino | 2 +- examples/05.Control/switchCase/switchCase.ino | 2 +- examples/05.Control/switchCase2/switchCase2.ino | 2 +- examples/06.Sensors/ADXL3xx/ADXL3xx.ino | 4 ++-- examples/06.Sensors/Knock/Knock.ino | 2 +- examples/06.Sensors/Memsic2125/Memsic2125.ino | 2 +- examples/06.Sensors/Ping/Ping.ino | 4 ++-- examples/07.Display/RowColumnScanning/RowColumnScanning.ino | 6 ++---- examples/07.Display/barGraph/barGraph.ino | 2 +- examples/08.Strings/CharacterAnalysis/CharacterAnalysis.ino | 2 +- .../StringAdditionOperator/StringAdditionOperator.ino | 2 +- .../StringAppendOperator/StringAppendOperator.ino | 2 +- examples/08.Strings/StringCaseChanges/StringCaseChanges.ino | 2 +- examples/08.Strings/StringCharacters/StringCharacters.ino | 2 +- .../StringComparisonOperators/StringComparisonOperators.ino | 2 +- .../08.Strings/StringConstructors/StringConstructors.ino | 2 +- examples/08.Strings/StringIndexOf/StringIndexOf.ino | 2 +- examples/08.Strings/StringLength/StringLength.ino | 2 +- examples/08.Strings/StringLengthTrim/StringLengthTrim.ino | 2 +- examples/08.Strings/StringReplace/StringReplace.ino | 2 +- .../StringStartsWithEndsWith/StringStartsWithEndsWith.ino | 2 +- examples/08.Strings/StringSubstring/StringSubstring.ino | 2 +- examples/08.Strings/StringToInt/StringToInt.ino | 2 +- examples/09.USB/Keyboard/KeyboardLogout/KeyboardLogout.ino | 2 +- .../09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino | 2 +- .../09.USB/Keyboard/KeyboardReprogram/KeyboardReprogram.ino | 2 +- examples/09.USB/Keyboard/KeyboardSerial/KeyboardSerial.ino | 2 +- .../KeyboardAndMouseControl/KeyboardAndMouseControl.ino | 2 +- .../09.USB/Mouse/ButtonMouseControl/ButtonMouseControl.ino | 2 +- .../Mouse/JoystickMouseControl/JoystickMouseControl.ino | 2 +- .../p02_SpaceshipInterface/p02_SpaceshipInterface.ino | 2 +- .../p03_LoveOMeter/p03_LoveOMeter.ino | 2 +- .../p04_ColorMixingLamp/p04_ColorMixingLamp.ino | 2 +- .../p05_ServoMoodIndicator/p05_ServoMoodIndicator.ino | 2 +- .../p06_LightTheremin/p06_LightTheremin.ino | 2 +- .../10.StarterKit_BasicKit/p07_Keyboard/p07_Keyboard.ino | 2 +- .../p08_DigitalHourglass/p08_DigitalHourglass.ino | 2 +- .../p09_MotorizedPinwheel/p09_MotorizedPinwheel.ino | 2 +- .../10.StarterKit_BasicKit/p10_Zoetrope/p10_Zoetrope.ino | 2 +- .../p11_CrystalBall/p11_CrystalBall.ino | 2 +- .../10.StarterKit_BasicKit/p12_KnockLock/p12_KnockLock.ino | 2 +- .../p13_TouchSensorLamp/p13_TouchSensorLamp.ino | 4 ++-- .../p14_TweakTheArduinoLogo/p14_TweakTheArduinoLogo.ino | 4 ++-- .../p15_HackingButtons/p15_HackingButtons.ino | 2 +- examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino | 2 +- 76 files changed, 81 insertions(+), 83 deletions(-) diff --git a/examples/01.Basics/Blink/Blink.ino b/examples/01.Basics/Blink/Blink.ino index b737725..9abb8f5 100644 --- a/examples/01.Basics/Blink/Blink.ino +++ b/examples/01.Basics/Blink/Blink.ino @@ -19,7 +19,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/Blink + https://www.arduino.cc/en/Tutorial/BuiltInExamples/Blink */ // the setup function runs once when you press reset or power the board diff --git a/examples/01.Basics/DigitalReadSerial/DigitalReadSerial.ino b/examples/01.Basics/DigitalReadSerial/DigitalReadSerial.ino index b3040af..49389fe 100644 --- a/examples/01.Basics/DigitalReadSerial/DigitalReadSerial.ino +++ b/examples/01.Basics/DigitalReadSerial/DigitalReadSerial.ino @@ -5,7 +5,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/DigitalReadSerial + https://www.arduino.cc/en/Tutorial/BuiltInExamples/DigitalReadSerial */ // digital pin 2 has a pushbutton attached to it. Give it a name: diff --git a/examples/01.Basics/Fade/Fade.ino b/examples/01.Basics/Fade/Fade.ino index 744dc42..e598b03 100644 --- a/examples/01.Basics/Fade/Fade.ino +++ b/examples/01.Basics/Fade/Fade.ino @@ -10,7 +10,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/Fade + https://www.arduino.cc/en/Tutorial/BuiltInExamples/Fade */ int led = 9; // the PWM pin the LED is attached to diff --git a/examples/01.Basics/ReadAnalogVoltage/ReadAnalogVoltage.ino b/examples/01.Basics/ReadAnalogVoltage/ReadAnalogVoltage.ino index 4473b4e..26e91e5 100644 --- a/examples/01.Basics/ReadAnalogVoltage/ReadAnalogVoltage.ino +++ b/examples/01.Basics/ReadAnalogVoltage/ReadAnalogVoltage.ino @@ -7,7 +7,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/ReadAnalogVoltage + https://www.arduino.cc/en/Tutorial/BuiltInExamples/ReadAnalogVoltage */ // the setup routine runs once when you press reset: diff --git a/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino b/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino index c96f3ba..ac47087 100644 --- a/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino +++ b/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino @@ -25,7 +25,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/BlinkWithoutDelay + https://www.arduino.cc/en/Tutorial/BuiltInExamples/BlinkWithoutDelay */ // constants won't change. Used here to set a pin number: diff --git a/examples/02.Digital/Button/Button.ino b/examples/02.Digital/Button/Button.ino index e2e9914..7732bc8 100644 --- a/examples/02.Digital/Button/Button.ino +++ b/examples/02.Digital/Button/Button.ino @@ -19,7 +19,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/Button + https://www.arduino.cc/en/Tutorial/BuiltInExamples/Button */ // constants won't change. They're used here to set pin numbers: diff --git a/examples/02.Digital/Debounce/Debounce.ino b/examples/02.Digital/Debounce/Debounce.ino index a550111..42cd1dc 100644 --- a/examples/02.Digital/Debounce/Debounce.ino +++ b/examples/02.Digital/Debounce/Debounce.ino @@ -24,7 +24,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/Debounce + https://www.arduino.cc/en/Tutorial/BuiltInExamples/Debounce */ // constants won't change. They're used here to set pin numbers: diff --git a/examples/02.Digital/DigitalInputPullup/DigitalInputPullup.ino b/examples/02.Digital/DigitalInputPullup/DigitalInputPullup.ino index dc641ac..16863a0 100644 --- a/examples/02.Digital/DigitalInputPullup/DigitalInputPullup.ino +++ b/examples/02.Digital/DigitalInputPullup/DigitalInputPullup.ino @@ -17,7 +17,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/InputPullupSerial + https://www.arduino.cc/en/Tutorial/BuiltInExamples/InputPullupSerial */ void setup() { diff --git a/examples/02.Digital/StateChangeDetection/StateChangeDetection.ino b/examples/02.Digital/StateChangeDetection/StateChangeDetection.ino index 66d7098..d3b2122 100644 --- a/examples/02.Digital/StateChangeDetection/StateChangeDetection.ino +++ b/examples/02.Digital/StateChangeDetection/StateChangeDetection.ino @@ -21,7 +21,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/ButtonStateChange + https://www.arduino.cc/en/Tutorial/BuiltInExamples/StateChangeDetection */ // this constant won't change: diff --git a/examples/02.Digital/toneKeyboard/toneKeyboard.ino b/examples/02.Digital/toneKeyboard/toneKeyboard.ino index 7a958c9..99e1cc5 100644 --- a/examples/02.Digital/toneKeyboard/toneKeyboard.ino +++ b/examples/02.Digital/toneKeyboard/toneKeyboard.ino @@ -14,7 +14,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/Tone3 + https://www.arduino.cc/en/Tutorial/BuiltInExamples/toneKeyboard */ #include "pitches.h" diff --git a/examples/02.Digital/toneMelody/toneMelody.ino b/examples/02.Digital/toneMelody/toneMelody.ino index 8cc1b53..22022dc 100644 --- a/examples/02.Digital/toneMelody/toneMelody.ino +++ b/examples/02.Digital/toneMelody/toneMelody.ino @@ -12,7 +12,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/Tone + https://www.arduino.cc/en/Tutorial/BuiltInExamples/toneMelody */ #include "pitches.h" diff --git a/examples/02.Digital/toneMultiple/toneMultiple.ino b/examples/02.Digital/toneMultiple/toneMultiple.ino index f21f572..63a6020 100644 --- a/examples/02.Digital/toneMultiple/toneMultiple.ino +++ b/examples/02.Digital/toneMultiple/toneMultiple.ino @@ -12,7 +12,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/Tone4 + https://www.arduino.cc/en/Tutorial/BuiltInExamples/toneMultiple */ void setup() { diff --git a/examples/02.Digital/tonePitchFollower/tonePitchFollower.ino b/examples/02.Digital/tonePitchFollower/tonePitchFollower.ino index c8d8567..3171cfc 100644 --- a/examples/02.Digital/tonePitchFollower/tonePitchFollower.ino +++ b/examples/02.Digital/tonePitchFollower/tonePitchFollower.ino @@ -14,7 +14,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/Tone2 + https://www.arduino.cc/en/Tutorial/BuiltInExamples/tonePitchFollower */ void setup() { diff --git a/examples/03.Analog/AnalogInOutSerial/AnalogInOutSerial.ino b/examples/03.Analog/AnalogInOutSerial/AnalogInOutSerial.ino index afb43ca..4033ca0 100644 --- a/examples/03.Analog/AnalogInOutSerial/AnalogInOutSerial.ino +++ b/examples/03.Analog/AnalogInOutSerial/AnalogInOutSerial.ino @@ -17,7 +17,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/AnalogInOutSerial + https://www.arduino.cc/en/Tutorial/BuiltInExamples/AnalogInOutSerial */ // These constants won't change. They're used to give names to the pins used: diff --git a/examples/03.Analog/AnalogInput/AnalogInput.ino b/examples/03.Analog/AnalogInput/AnalogInput.ino index 96e9d0e..9a1bbdd 100644 --- a/examples/03.Analog/AnalogInput/AnalogInput.ino +++ b/examples/03.Analog/AnalogInput/AnalogInput.ino @@ -24,7 +24,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/AnalogInput + https://www.arduino.cc/en/Tutorial/BuiltInExamples/AnalogInput */ int sensorPin = A0; // select the input pin for the potentiometer diff --git a/examples/03.Analog/AnalogWriteMega/AnalogWriteMega.ino b/examples/03.Analog/AnalogWriteMega/AnalogWriteMega.ino index 37a62a1..9d938d2 100644 --- a/examples/03.Analog/AnalogWriteMega/AnalogWriteMega.ino +++ b/examples/03.Analog/AnalogWriteMega/AnalogWriteMega.ino @@ -12,7 +12,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/AnalogWriteMega + https://www.arduino.cc/en/Tutorial/BuiltInExamples/AnalogWriteMega */ // These constants won't change. They're used to give names to the pins used: diff --git a/examples/03.Analog/Calibration/Calibration.ino b/examples/03.Analog/Calibration/Calibration.ino index d75f45a..ba5cf70 100644 --- a/examples/03.Analog/Calibration/Calibration.ino +++ b/examples/03.Analog/Calibration/Calibration.ino @@ -23,7 +23,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/Calibration + https://www.arduino.cc/en/Tutorial/BuiltInExamples/Calibration */ // These constants won't change: diff --git a/examples/03.Analog/Fading/Fading.ino b/examples/03.Analog/Fading/Fading.ino index ed76e6f..da694e5 100644 --- a/examples/03.Analog/Fading/Fading.ino +++ b/examples/03.Analog/Fading/Fading.ino @@ -13,7 +13,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/Fading + https://www.arduino.cc/en/Tutorial/BuiltInExamples/Fading */ int ledPin = 9; // LED connected to digital pin 9 diff --git a/examples/03.Analog/Smoothing/Smoothing.ino b/examples/03.Analog/Smoothing/Smoothing.ino index 5df0d05..eece339 100644 --- a/examples/03.Analog/Smoothing/Smoothing.ino +++ b/examples/03.Analog/Smoothing/Smoothing.ino @@ -15,7 +15,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/Smoothing + https://www.arduino.cc/en/Tutorial/BuiltInExamples/Smoothing */ // Define the number of samples to keep track of. The higher the number, the diff --git a/examples/04.Communication/ASCIITable/ASCIITable.ino b/examples/04.Communication/ASCIITable/ASCIITable.ino index 7cf55d0..f3d4bd0 100644 --- a/examples/04.Communication/ASCIITable/ASCIITable.ino +++ b/examples/04.Communication/ASCIITable/ASCIITable.ino @@ -16,7 +16,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/ASCIITable + https://www.arduino.cc/en/Tutorial/BuiltInExamples/ASCIITable */ void setup() { diff --git a/examples/04.Communication/Dimmer/Dimmer.ino b/examples/04.Communication/Dimmer/Dimmer.ino index 010b41a..fc121a0 100644 --- a/examples/04.Communication/Dimmer/Dimmer.ino +++ b/examples/04.Communication/Dimmer/Dimmer.ino @@ -17,7 +17,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/Dimmer + https://www.arduino.cc/en/Tutorial/BuiltInExamples/Dimmer */ const int ledPin = 9; // the pin that the LED is attached to diff --git a/examples/04.Communication/Graph/Graph.ino b/examples/04.Communication/Graph/Graph.ino index 8be36d2..b50ca37 100644 --- a/examples/04.Communication/Graph/Graph.ino +++ b/examples/04.Communication/Graph/Graph.ino @@ -22,7 +22,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/Graph + https://www.arduino.cc/en/Tutorial/BuiltInExamples/Graph */ void setup() { diff --git a/examples/04.Communication/Midi/Midi.ino b/examples/04.Communication/Midi/Midi.ino index 5ef3406..851fa9b 100644 --- a/examples/04.Communication/Midi/Midi.ino +++ b/examples/04.Communication/Midi/Midi.ino @@ -17,7 +17,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/Midi + https://www.arduino.cc/en/Tutorial/BuiltInExamples/Midi */ void setup() { diff --git a/examples/04.Communication/PhysicalPixel/PhysicalPixel.ino b/examples/04.Communication/PhysicalPixel/PhysicalPixel.ino index b08188b..1582118 100644 --- a/examples/04.Communication/PhysicalPixel/PhysicalPixel.ino +++ b/examples/04.Communication/PhysicalPixel/PhysicalPixel.ino @@ -18,7 +18,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/PhysicalPixel + https://www.arduino.cc/en/Tutorial/BuiltInExamples/PhysicalPixel */ const int ledPin = 13; // the pin that the LED is attached to diff --git a/examples/04.Communication/SerialCallResponse/SerialCallResponse.ino b/examples/04.Communication/SerialCallResponse/SerialCallResponse.ino index b59204f..6fb0a60 100644 --- a/examples/04.Communication/SerialCallResponse/SerialCallResponse.ino +++ b/examples/04.Communication/SerialCallResponse/SerialCallResponse.ino @@ -18,7 +18,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/SerialCallResponse + https://www.arduino.cc/en/Tutorial/BuiltInExamples/SerialCallResponse */ int firstSensor = 0; // first analog sensor diff --git a/examples/04.Communication/SerialCallResponseASCII/SerialCallResponseASCII.ino b/examples/04.Communication/SerialCallResponseASCII/SerialCallResponseASCII.ino index f14206c..44b2155 100644 --- a/examples/04.Communication/SerialCallResponseASCII/SerialCallResponseASCII.ino +++ b/examples/04.Communication/SerialCallResponseASCII/SerialCallResponseASCII.ino @@ -19,7 +19,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/SerialCallResponseASCII + https://www.arduino.cc/en/Tutorial/BuiltInExamples/SerialCallResponseASCII */ int firstSensor = 0; // first analog sensor diff --git a/examples/04.Communication/SerialEvent/SerialEvent.ino b/examples/04.Communication/SerialEvent/SerialEvent.ino index 1ec4049..831b98d 100644 --- a/examples/04.Communication/SerialEvent/SerialEvent.ino +++ b/examples/04.Communication/SerialEvent/SerialEvent.ino @@ -15,7 +15,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/SerialEvent + https://www.arduino.cc/en/Tutorial/BuiltInExamples/SerialEvent */ String inputString = ""; // a String to hold incoming data diff --git a/examples/04.Communication/VirtualColorMixer/VirtualColorMixer.ino b/examples/04.Communication/VirtualColorMixer/VirtualColorMixer.ino index d674d59..cf66348 100644 --- a/examples/04.Communication/VirtualColorMixer/VirtualColorMixer.ino +++ b/examples/04.Communication/VirtualColorMixer/VirtualColorMixer.ino @@ -13,7 +13,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/VirtualColorMixer + https://www.arduino.cc/en/Tutorial/BuiltInExamples/VirtualColorMixer */ const int redPin = A0; // sensor to control red color diff --git a/examples/05.Control/Arrays/Arrays.ino b/examples/05.Control/Arrays/Arrays.ino index 549ac34..dbbb4b4 100644 --- a/examples/05.Control/Arrays/Arrays.ino +++ b/examples/05.Control/Arrays/Arrays.ino @@ -17,7 +17,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/Array + https://www.arduino.cc/en/Tutorial/BuiltInExamples/Arrays */ int timer = 100; // The higher the number, the slower the timing. diff --git a/examples/05.Control/ForLoopIteration/ForLoopIteration.ino b/examples/05.Control/ForLoopIteration/ForLoopIteration.ino index 54ad38a..af9cd7d 100644 --- a/examples/05.Control/ForLoopIteration/ForLoopIteration.ino +++ b/examples/05.Control/ForLoopIteration/ForLoopIteration.ino @@ -14,7 +14,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/ForLoop + https://www.arduino.cc/en/Tutorial/BuiltInExamples/ForLoopIteration */ int timer = 100; // The higher the number, the slower the timing. diff --git a/examples/05.Control/IfStatementConditional/IfStatementConditional.ino b/examples/05.Control/IfStatementConditional/IfStatementConditional.ino index 95b6910..efd233f 100644 --- a/examples/05.Control/IfStatementConditional/IfStatementConditional.ino +++ b/examples/05.Control/IfStatementConditional/IfStatementConditional.ino @@ -21,7 +21,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/IfStatement + https://www.arduino.cc/en/Tutorial/BuiltInExamples/ifStatementConditional */ // These constants won't change: diff --git a/examples/05.Control/WhileStatementConditional/WhileStatementConditional.ino b/examples/05.Control/WhileStatementConditional/WhileStatementConditional.ino index 4f1383f..a0b42e1 100644 --- a/examples/05.Control/WhileStatementConditional/WhileStatementConditional.ino +++ b/examples/05.Control/WhileStatementConditional/WhileStatementConditional.ino @@ -24,7 +24,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/WhileLoop + https://www.arduino.cc/en/Tutorial/BuiltInExamples/WhileStatementConditional */ diff --git a/examples/05.Control/switchCase/switchCase.ino b/examples/05.Control/switchCase/switchCase.ino index c313f6b..3ffc9f0 100644 --- a/examples/05.Control/switchCase/switchCase.ino +++ b/examples/05.Control/switchCase/switchCase.ino @@ -18,7 +18,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/SwitchCase + https://www.arduino.cc/en/Tutorial/BuiltInExamples/SwitchCase */ // these constants won't change. They are the lowest and highest readings you diff --git a/examples/05.Control/switchCase2/switchCase2.ino b/examples/05.Control/switchCase2/switchCase2.ino index c30843f..48cbaa4 100644 --- a/examples/05.Control/switchCase2/switchCase2.ino +++ b/examples/05.Control/switchCase2/switchCase2.ino @@ -17,7 +17,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/SwitchCase2 + https://www.arduino.cc/en/Tutorial/BuiltInExamples/SwitchCase2 */ void setup() { diff --git a/examples/06.Sensors/ADXL3xx/ADXL3xx.ino b/examples/06.Sensors/ADXL3xx/ADXL3xx.ino index 1cf4be4..65b579b 100644 --- a/examples/06.Sensors/ADXL3xx/ADXL3xx.ino +++ b/examples/06.Sensors/ADXL3xx/ADXL3xx.ino @@ -4,7 +4,7 @@ Reads an Analog Devices ADXL3xx accelerometer and communicates the acceleration to the computer. The pins used are designed to be easily compatible with the breakout boards from SparkFun, available from: - http://www.sparkfun.com/commerce/categories.php?c=80 + https://www.sparkfun.com/categories/80 The circuit: - analog 0: accelerometer self test @@ -21,7 +21,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/ADXL3xx + https://www.arduino.cc/en/Tutorial/BuiltInExamples/ADXL3xx */ // these constants describe the pins. They won't change: diff --git a/examples/06.Sensors/Knock/Knock.ino b/examples/06.Sensors/Knock/Knock.ino index 99b50e4..815d721 100644 --- a/examples/06.Sensors/Knock/Knock.ino +++ b/examples/06.Sensors/Knock/Knock.ino @@ -18,7 +18,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/Knock + https://www.arduino.cc/en/Tutorial/BuiltInExamples/Knock */ diff --git a/examples/06.Sensors/Memsic2125/Memsic2125.ino b/examples/06.Sensors/Memsic2125/Memsic2125.ino index da69df9..b95472b 100644 --- a/examples/06.Sensors/Memsic2125/Memsic2125.ino +++ b/examples/06.Sensors/Memsic2125/Memsic2125.ino @@ -18,7 +18,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/Memsic2125 + https://www.arduino.cc/en/Tutorial/BuiltInExamples/Memsic2125 */ // these constants won't change: diff --git a/examples/06.Sensors/Ping/Ping.ino b/examples/06.Sensors/Ping/Ping.ino index cdde18e..2d9a0da 100644 --- a/examples/06.Sensors/Ping/Ping.ino +++ b/examples/06.Sensors/Ping/Ping.ino @@ -18,7 +18,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/Ping + https://www.arduino.cc/en/Tutorial/BuiltInExamples/Ping */ // this constant won't change. It's the pin number of the sensor's output: @@ -67,7 +67,7 @@ long microsecondsToInches(long microseconds) { // microseconds per inch (i.e. sound travels at 1130 feet per second). // This gives the distance travelled by the ping, outbound and return, // so we divide by 2 to get the distance of the obstacle. - // See: http://www.parallax.com/dl/docs/prod/acc/28015-PING-v1.3.pdf + // See: https://www.parallax.com/package/ping-ultrasonic-distance-sensor-downloads/ return microseconds / 74 / 2; } diff --git a/examples/07.Display/RowColumnScanning/RowColumnScanning.ino b/examples/07.Display/RowColumnScanning/RowColumnScanning.ino index f2cf795..023a5c2 100644 --- a/examples/07.Display/RowColumnScanning/RowColumnScanning.ino +++ b/examples/07.Display/RowColumnScanning/RowColumnScanning.ino @@ -4,7 +4,7 @@ This example controls an 8x8 LED matrix using two analog inputs. This example works for the Lumex LDM-24488NI Matrix. See - http://sigma.octopart.com/140413/datasheet/Lumex-LDM-24488NI.pdf + https://sigma.octopart.com/140413/datasheet/Lumex-LDM-24488NI.pdf for the pin connections. For other LED cathode column matrixes, you should only need to change the pin @@ -28,9 +28,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/RowColumnScanning - - see also http://www.tigoe.net/pcomp/code/category/arduinowiring for more + https://www.arduino.cc/en/Tutorial/BuiltInExamples/RowColumnScanning */ // 2-dimensional array of row pin numbers: diff --git a/examples/07.Display/barGraph/barGraph.ino b/examples/07.Display/barGraph/barGraph.ino index 48327a9..ab97f13 100644 --- a/examples/07.Display/barGraph/barGraph.ino +++ b/examples/07.Display/barGraph/barGraph.ino @@ -17,7 +17,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/BarGraph + https://www.arduino.cc/en/Tutorial/BuiltInExamples/BarGraph */ // these constants won't change: diff --git a/examples/08.Strings/CharacterAnalysis/CharacterAnalysis.ino b/examples/08.Strings/CharacterAnalysis/CharacterAnalysis.ino index 07a89c5..e7a3c23 100644 --- a/examples/08.Strings/CharacterAnalysis/CharacterAnalysis.ino +++ b/examples/08.Strings/CharacterAnalysis/CharacterAnalysis.ino @@ -10,7 +10,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/CharacterAnalysis + https://www.arduino.cc/en/Tutorial/BuiltInExamples/CharacterAnalysis */ void setup() { diff --git a/examples/08.Strings/StringAdditionOperator/StringAdditionOperator.ino b/examples/08.Strings/StringAdditionOperator/StringAdditionOperator.ino index 5f65e50..531742b 100644 --- a/examples/08.Strings/StringAdditionOperator/StringAdditionOperator.ino +++ b/examples/08.Strings/StringAdditionOperator/StringAdditionOperator.ino @@ -10,7 +10,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/StringAdditionOperator + https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringAdditionOperator */ // declare three Strings: diff --git a/examples/08.Strings/StringAppendOperator/StringAppendOperator.ino b/examples/08.Strings/StringAppendOperator/StringAppendOperator.ino index abdfe76..b634892 100644 --- a/examples/08.Strings/StringAppendOperator/StringAppendOperator.ino +++ b/examples/08.Strings/StringAppendOperator/StringAppendOperator.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/StringAppendOperator + https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringAppendOperator */ String stringOne, stringTwo; diff --git a/examples/08.Strings/StringCaseChanges/StringCaseChanges.ino b/examples/08.Strings/StringCaseChanges/StringCaseChanges.ino index 78a1270..fc6ab61 100644 --- a/examples/08.Strings/StringCaseChanges/StringCaseChanges.ino +++ b/examples/08.Strings/StringCaseChanges/StringCaseChanges.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/StringCaseChanges + https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringCaseChanges */ void setup() { diff --git a/examples/08.Strings/StringCharacters/StringCharacters.ino b/examples/08.Strings/StringCharacters/StringCharacters.ino index f985e79..a179cfa 100644 --- a/examples/08.Strings/StringCharacters/StringCharacters.ino +++ b/examples/08.Strings/StringCharacters/StringCharacters.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/StringCharacters + https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringCharacters */ void setup() { diff --git a/examples/08.Strings/StringComparisonOperators/StringComparisonOperators.ino b/examples/08.Strings/StringComparisonOperators/StringComparisonOperators.ino index 48540f9..aff9139 100644 --- a/examples/08.Strings/StringComparisonOperators/StringComparisonOperators.ino +++ b/examples/08.Strings/StringComparisonOperators/StringComparisonOperators.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/StringComparisonOperators + https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringComparisonOperators */ String stringOne, stringTwo; diff --git a/examples/08.Strings/StringConstructors/StringConstructors.ino b/examples/08.Strings/StringConstructors/StringConstructors.ino index 414dd8d..85d0024 100644 --- a/examples/08.Strings/StringConstructors/StringConstructors.ino +++ b/examples/08.Strings/StringConstructors/StringConstructors.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/StringConstructors + https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringConstructors */ void setup() { diff --git a/examples/08.Strings/StringIndexOf/StringIndexOf.ino b/examples/08.Strings/StringIndexOf/StringIndexOf.ino index bac9f81..219f508 100644 --- a/examples/08.Strings/StringIndexOf/StringIndexOf.ino +++ b/examples/08.Strings/StringIndexOf/StringIndexOf.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/StringIndexOf + https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringIndexOf */ void setup() { diff --git a/examples/08.Strings/StringLength/StringLength.ino b/examples/08.Strings/StringLength/StringLength.ino index 0fe5203..ef57b74 100644 --- a/examples/08.Strings/StringLength/StringLength.ino +++ b/examples/08.Strings/StringLength/StringLength.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/StringLengthTrim + https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringLengthTrim */ String txtMsg = ""; // a string for incoming text diff --git a/examples/08.Strings/StringLengthTrim/StringLengthTrim.ino b/examples/08.Strings/StringLengthTrim/StringLengthTrim.ino index d107c8f..b253087 100644 --- a/examples/08.Strings/StringLengthTrim/StringLengthTrim.ino +++ b/examples/08.Strings/StringLengthTrim/StringLengthTrim.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/StringLengthTrim + https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringLengthTrim */ void setup() { diff --git a/examples/08.Strings/StringReplace/StringReplace.ino b/examples/08.Strings/StringReplace/StringReplace.ino index 17407f1..907f5d0 100644 --- a/examples/08.Strings/StringReplace/StringReplace.ino +++ b/examples/08.Strings/StringReplace/StringReplace.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/StringReplace + https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringReplace */ void setup() { diff --git a/examples/08.Strings/StringStartsWithEndsWith/StringStartsWithEndsWith.ino b/examples/08.Strings/StringStartsWithEndsWith/StringStartsWithEndsWith.ino index 6ea6f2c..ff5563c 100644 --- a/examples/08.Strings/StringStartsWithEndsWith/StringStartsWithEndsWith.ino +++ b/examples/08.Strings/StringStartsWithEndsWith/StringStartsWithEndsWith.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/StringStartsWithEndsWith + https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringStartsWithEndsWith */ void setup() { diff --git a/examples/08.Strings/StringSubstring/StringSubstring.ino b/examples/08.Strings/StringSubstring/StringSubstring.ino index ccdf2f3..1c0854a 100644 --- a/examples/08.Strings/StringSubstring/StringSubstring.ino +++ b/examples/08.Strings/StringSubstring/StringSubstring.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/StringSubstring + https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringSubstring */ void setup() { diff --git a/examples/08.Strings/StringToInt/StringToInt.ino b/examples/08.Strings/StringToInt/StringToInt.ino index 59e872a..81e48e5 100644 --- a/examples/08.Strings/StringToInt/StringToInt.ino +++ b/examples/08.Strings/StringToInt/StringToInt.ino @@ -12,7 +12,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/StringToInt + https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringToInt */ String inString = ""; // string to hold input diff --git a/examples/09.USB/Keyboard/KeyboardLogout/KeyboardLogout.ino b/examples/09.USB/Keyboard/KeyboardLogout/KeyboardLogout.ino index f6ea490..28c59f9 100644 --- a/examples/09.USB/Keyboard/KeyboardLogout/KeyboardLogout.ino +++ b/examples/09.USB/Keyboard/KeyboardLogout/KeyboardLogout.ino @@ -22,7 +22,7 @@ This example is in the public domain. - http://www.arduino.cc/en/Tutorial/KeyboardLogout + https://www.arduino.cc/en/Tutorial/BuiltInExamples/KeyboardLogout */ #define OSX 0 diff --git a/examples/09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino b/examples/09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino index 32c3b9f..f0bd32b 100644 --- a/examples/09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino +++ b/examples/09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino @@ -17,7 +17,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/KeyboardMessage + https://www.arduino.cc/en/Tutorial/BuiltInExamples/KeyboardMessage */ #include "Keyboard.h" diff --git a/examples/09.USB/Keyboard/KeyboardReprogram/KeyboardReprogram.ino b/examples/09.USB/Keyboard/KeyboardReprogram/KeyboardReprogram.ino index 7ec0d6d..d86f944 100644 --- a/examples/09.USB/Keyboard/KeyboardReprogram/KeyboardReprogram.ino +++ b/examples/09.USB/Keyboard/KeyboardReprogram/KeyboardReprogram.ino @@ -22,7 +22,7 @@ This example is in the public domain. - http://www.arduino.cc/en/Tutorial/KeyboardReprogram + https://www.arduino.cc/en/Tutorial/BuiltInExamples/KeyboardReprogram */ #include "Keyboard.h" diff --git a/examples/09.USB/Keyboard/KeyboardSerial/KeyboardSerial.ino b/examples/09.USB/Keyboard/KeyboardSerial/KeyboardSerial.ino index 72d9ddd..050bb18 100644 --- a/examples/09.USB/Keyboard/KeyboardSerial/KeyboardSerial.ino +++ b/examples/09.USB/Keyboard/KeyboardSerial/KeyboardSerial.ino @@ -16,7 +16,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/KeyboardSerial + https://www.arduino.cc/en/Tutorial/BuiltInExamples/KeyboardSerial */ #include "Keyboard.h" diff --git a/examples/09.USB/KeyboardAndMouseControl/KeyboardAndMouseControl.ino b/examples/09.USB/KeyboardAndMouseControl/KeyboardAndMouseControl.ino index 9713541..8850067 100644 --- a/examples/09.USB/KeyboardAndMouseControl/KeyboardAndMouseControl.ino +++ b/examples/09.USB/KeyboardAndMouseControl/KeyboardAndMouseControl.ino @@ -18,7 +18,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/KeyboardAndMouseControl + https://www.arduino.cc/en/Tutorial/BuiltInExamples/KeyboardAndMouseControl */ #include "Keyboard.h" diff --git a/examples/09.USB/Mouse/ButtonMouseControl/ButtonMouseControl.ino b/examples/09.USB/Mouse/ButtonMouseControl/ButtonMouseControl.ino index 9c78eda..2e0da7a 100644 --- a/examples/09.USB/Mouse/ButtonMouseControl/ButtonMouseControl.ino +++ b/examples/09.USB/Mouse/ButtonMouseControl/ButtonMouseControl.ino @@ -20,7 +20,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/ButtonMouseControl + https://www.arduino.cc/en/Tutorial/BuiltInExamples/ButtonMouseControl */ #include "Mouse.h" diff --git a/examples/09.USB/Mouse/JoystickMouseControl/JoystickMouseControl.ino b/examples/09.USB/Mouse/JoystickMouseControl/JoystickMouseControl.ino index aa608f8..92d00f6 100644 --- a/examples/09.USB/Mouse/JoystickMouseControl/JoystickMouseControl.ino +++ b/examples/09.USB/Mouse/JoystickMouseControl/JoystickMouseControl.ino @@ -26,7 +26,7 @@ This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/JoystickMouseControl + https://www.arduino.cc/en/Tutorial/BuiltInExamples/JoystickMouseControl */ #include "Mouse.h" diff --git a/examples/10.StarterKit_BasicKit/p02_SpaceshipInterface/p02_SpaceshipInterface.ino b/examples/10.StarterKit_BasicKit/p02_SpaceshipInterface/p02_SpaceshipInterface.ino index 41283da..5acf9de 100644 --- a/examples/10.StarterKit_BasicKit/p02_SpaceshipInterface/p02_SpaceshipInterface.ino +++ b/examples/10.StarterKit_BasicKit/p02_SpaceshipInterface/p02_SpaceshipInterface.ino @@ -14,7 +14,7 @@ created 13 Sep 2012 by Scott Fitzgerald - http://www.arduino.cc/starterKit + https://store.arduino.cc/genuino-starter-kit This example code is part of the public domain. */ diff --git a/examples/10.StarterKit_BasicKit/p03_LoveOMeter/p03_LoveOMeter.ino b/examples/10.StarterKit_BasicKit/p03_LoveOMeter/p03_LoveOMeter.ino index 2a72f46..57959ed 100644 --- a/examples/10.StarterKit_BasicKit/p03_LoveOMeter/p03_LoveOMeter.ino +++ b/examples/10.StarterKit_BasicKit/p03_LoveOMeter/p03_LoveOMeter.ino @@ -12,7 +12,7 @@ created 13 Sep 2012 by Scott Fitzgerald - http://www.arduino.cc/starterKit + https://store.arduino.cc/genuino-starter-kit This example code is part of the public domain. */ diff --git a/examples/10.StarterKit_BasicKit/p04_ColorMixingLamp/p04_ColorMixingLamp.ino b/examples/10.StarterKit_BasicKit/p04_ColorMixingLamp/p04_ColorMixingLamp.ino index 1e15f1c..09f3121 100644 --- a/examples/10.StarterKit_BasicKit/p04_ColorMixingLamp/p04_ColorMixingLamp.ino +++ b/examples/10.StarterKit_BasicKit/p04_ColorMixingLamp/p04_ColorMixingLamp.ino @@ -16,7 +16,7 @@ by Scott Fitzgerald Thanks to Federico Vanzati for improvements - http://www.arduino.cc/starterKit + https://store.arduino.cc/genuino-starter-kit This example code is part of the public domain. */ diff --git a/examples/10.StarterKit_BasicKit/p05_ServoMoodIndicator/p05_ServoMoodIndicator.ino b/examples/10.StarterKit_BasicKit/p05_ServoMoodIndicator/p05_ServoMoodIndicator.ino index b56e860..9e042ed 100644 --- a/examples/10.StarterKit_BasicKit/p05_ServoMoodIndicator/p05_ServoMoodIndicator.ino +++ b/examples/10.StarterKit_BasicKit/p05_ServoMoodIndicator/p05_ServoMoodIndicator.ino @@ -12,7 +12,7 @@ created 13 Sep 2012 by Scott Fitzgerald - http://www.arduino.cc/starterKit + https://store.arduino.cc/genuino-starter-kit This example code is part of the public domain. */ diff --git a/examples/10.StarterKit_BasicKit/p06_LightTheremin/p06_LightTheremin.ino b/examples/10.StarterKit_BasicKit/p06_LightTheremin/p06_LightTheremin.ino index 6f6475c..1b79405 100644 --- a/examples/10.StarterKit_BasicKit/p06_LightTheremin/p06_LightTheremin.ino +++ b/examples/10.StarterKit_BasicKit/p06_LightTheremin/p06_LightTheremin.ino @@ -12,7 +12,7 @@ created 13 Sep 2012 by Scott Fitzgerald - http://www.arduino.cc/starterKit + https://store.arduino.cc/genuino-starter-kit This example code is part of the public domain. */ diff --git a/examples/10.StarterKit_BasicKit/p07_Keyboard/p07_Keyboard.ino b/examples/10.StarterKit_BasicKit/p07_Keyboard/p07_Keyboard.ino index ad39bd1..bf53da7 100644 --- a/examples/10.StarterKit_BasicKit/p07_Keyboard/p07_Keyboard.ino +++ b/examples/10.StarterKit_BasicKit/p07_Keyboard/p07_Keyboard.ino @@ -14,7 +14,7 @@ created 13 Sep 2012 by Scott Fitzgerald - http://www.arduino.cc/starterKit + https://store.arduino.cc/genuino-starter-kit This example code is part of the public domain. */ diff --git a/examples/10.StarterKit_BasicKit/p08_DigitalHourglass/p08_DigitalHourglass.ino b/examples/10.StarterKit_BasicKit/p08_DigitalHourglass/p08_DigitalHourglass.ino index 801f8cd..0d7004b 100644 --- a/examples/10.StarterKit_BasicKit/p08_DigitalHourglass/p08_DigitalHourglass.ino +++ b/examples/10.StarterKit_BasicKit/p08_DigitalHourglass/p08_DigitalHourglass.ino @@ -13,7 +13,7 @@ created 13 Sep 2012 by Scott Fitzgerald - http://www.arduino.cc/starterKit + https://store.arduino.cc/genuino-starter-kit This example code is part of the public domain. */ diff --git a/examples/10.StarterKit_BasicKit/p09_MotorizedPinwheel/p09_MotorizedPinwheel.ino b/examples/10.StarterKit_BasicKit/p09_MotorizedPinwheel/p09_MotorizedPinwheel.ino index 23e19b1..56c465d 100644 --- a/examples/10.StarterKit_BasicKit/p09_MotorizedPinwheel/p09_MotorizedPinwheel.ino +++ b/examples/10.StarterKit_BasicKit/p09_MotorizedPinwheel/p09_MotorizedPinwheel.ino @@ -15,7 +15,7 @@ created 13 Sep 2012 by Scott Fitzgerald - http://www.arduino.cc/starterKit + https://store.arduino.cc/genuino-starter-kit This example code is part of the public domain. */ diff --git a/examples/10.StarterKit_BasicKit/p10_Zoetrope/p10_Zoetrope.ino b/examples/10.StarterKit_BasicKit/p10_Zoetrope/p10_Zoetrope.ino index 4d675ed..69ac37e 100644 --- a/examples/10.StarterKit_BasicKit/p10_Zoetrope/p10_Zoetrope.ino +++ b/examples/10.StarterKit_BasicKit/p10_Zoetrope/p10_Zoetrope.ino @@ -16,7 +16,7 @@ by Scott Fitzgerald Thanks to Federico Vanzati for improvements - http://www.arduino.cc/starterKit + https://store.arduino.cc/genuino-starter-kit This example code is part of the public domain. */ diff --git a/examples/10.StarterKit_BasicKit/p11_CrystalBall/p11_CrystalBall.ino b/examples/10.StarterKit_BasicKit/p11_CrystalBall/p11_CrystalBall.ino index 63aefc4..a5a6acb 100644 --- a/examples/10.StarterKit_BasicKit/p11_CrystalBall/p11_CrystalBall.ino +++ b/examples/10.StarterKit_BasicKit/p11_CrystalBall/p11_CrystalBall.ino @@ -14,7 +14,7 @@ created 13 Sep 2012 by Scott Fitzgerald - http://www.arduino.cc/starterKit + https://store.arduino.cc/genuino-starter-kit This example code is part of the public domain. */ diff --git a/examples/10.StarterKit_BasicKit/p12_KnockLock/p12_KnockLock.ino b/examples/10.StarterKit_BasicKit/p12_KnockLock/p12_KnockLock.ino index 95027ec..a952307 100644 --- a/examples/10.StarterKit_BasicKit/p12_KnockLock/p12_KnockLock.ino +++ b/examples/10.StarterKit_BasicKit/p12_KnockLock/p12_KnockLock.ino @@ -20,7 +20,7 @@ by Scott Fitzgerald Thanks to Federico Vanzati for improvements - http://www.arduino.cc/starterKit + https://store.arduino.cc/genuino-starter-kit This example code is part of the public domain. */ diff --git a/examples/10.StarterKit_BasicKit/p13_TouchSensorLamp/p13_TouchSensorLamp.ino b/examples/10.StarterKit_BasicKit/p13_TouchSensorLamp/p13_TouchSensorLamp.ino index 8f7a28a..4f25cbe 100644 --- a/examples/10.StarterKit_BasicKit/p13_TouchSensorLamp/p13_TouchSensorLamp.ino +++ b/examples/10.StarterKit_BasicKit/p13_TouchSensorLamp/p13_TouchSensorLamp.ino @@ -12,12 +12,12 @@ Software required : - CapacitiveSensor library by Paul Badger - http://www.arduino.cc/playground/Main/CapacitiveSensor + https://www.arduino.cc/reference/en/libraries/capacitivesensor/ created 18 Sep 2012 by Scott Fitzgerald - http://www.arduino.cc/starterKit + https://store.arduino.cc/genuino-starter-kit This example code is part of the public domain. */ diff --git a/examples/10.StarterKit_BasicKit/p14_TweakTheArduinoLogo/p14_TweakTheArduinoLogo.ino b/examples/10.StarterKit_BasicKit/p14_TweakTheArduinoLogo/p14_TweakTheArduinoLogo.ino index e9279e2..043b600 100644 --- a/examples/10.StarterKit_BasicKit/p14_TweakTheArduinoLogo/p14_TweakTheArduinoLogo.ino +++ b/examples/10.StarterKit_BasicKit/p14_TweakTheArduinoLogo/p14_TweakTheArduinoLogo.ino @@ -8,13 +8,13 @@ - 10 kilohm potentiometer Software required: - - Processing (3.0 or newer) http://processing.org + - Processing (3.0 or newer) https://processing.org/ - Active Internet connection created 18 Sep 2012 by Scott Fitzgerald - http://www.arduino.cc/starterKit + https://store.arduino.cc/genuino-starter-kit This example code is part of the public domain. */ diff --git a/examples/10.StarterKit_BasicKit/p15_HackingButtons/p15_HackingButtons.ino b/examples/10.StarterKit_BasicKit/p15_HackingButtons/p15_HackingButtons.ino index d5d530a..28daed0 100644 --- a/examples/10.StarterKit_BasicKit/p15_HackingButtons/p15_HackingButtons.ino +++ b/examples/10.StarterKit_BasicKit/p15_HackingButtons/p15_HackingButtons.ino @@ -12,7 +12,7 @@ created 18 Sep 2012 by Scott Fitzgerald - http://www.arduino.cc/starterKit + https://store.arduino.cc/genuino-starter-kit This example code is part of the public domain. */ diff --git a/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino b/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino index 52d8469..4dec0c6 100644 --- a/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino +++ b/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino @@ -1,7 +1,7 @@ // ArduinoISP // Copyright (c) 2008-2011 Randall Bohn // If you require a license, see -// http://www.opensource.org/licenses/bsd-license.php +// https://opensource.org/licenses/bsd-license.php // // This sketch turns the Arduino into a AVRISP using the following Arduino pins: // From df89e3c2688388545c7003ca7d40a4d73403b792 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 28 Mar 2021 00:47:17 -0700 Subject: [PATCH 08/59] Add missing tutorial links to examples --- examples/04.Communication/MultiSerial/MultiSerial.ino | 2 ++ examples/04.Communication/ReadASCIIString/ReadASCIIString.ino | 2 ++ .../04.Communication/SerialPassthrough/SerialPassthrough.ino | 2 ++ 3 files changed, 6 insertions(+) diff --git a/examples/04.Communication/MultiSerial/MultiSerial.ino b/examples/04.Communication/MultiSerial/MultiSerial.ino index d356f51..20fc441 100644 --- a/examples/04.Communication/MultiSerial/MultiSerial.ino +++ b/examples/04.Communication/MultiSerial/MultiSerial.ino @@ -17,6 +17,8 @@ by Arturo Guadalupi This example code is in the public domain. + + https://www.arduino.cc/en/Tutorial/BuiltInExamples/MultiSerialMega */ diff --git a/examples/04.Communication/ReadASCIIString/ReadASCIIString.ino b/examples/04.Communication/ReadASCIIString/ReadASCIIString.ino index e49a989..bbd395b 100644 --- a/examples/04.Communication/ReadASCIIString/ReadASCIIString.ino +++ b/examples/04.Communication/ReadASCIIString/ReadASCIIString.ino @@ -17,6 +17,8 @@ by Arturo Guadalupi This example code is in the public domain. + + https://www.arduino.cc/en/Tutorial/BuiltInExamples/ReadASCIIString */ // pins for the LEDs: diff --git a/examples/04.Communication/SerialPassthrough/SerialPassthrough.ino b/examples/04.Communication/SerialPassthrough/SerialPassthrough.ino index 81037eb..84824cf 100644 --- a/examples/04.Communication/SerialPassthrough/SerialPassthrough.ino +++ b/examples/04.Communication/SerialPassthrough/SerialPassthrough.ino @@ -20,6 +20,8 @@ created 23 May 2016 by Erik Nyquist + + https://www.arduino.cc/en/Tutorial/BuiltInExamples/SerialPassthrough */ void setup() { From 801e18e085a8ee103b89ffb7a2a3bfaf9a2d51f2 Mon Sep 17 00:00:00 2001 From: per1234 Date: Fri, 7 May 2021 00:52:59 -0700 Subject: [PATCH 09/59] Add Creative Commons Zero v1.0 Universal license file This is the exact text of the license from choosealicense.com. This provides a default license that applies to all contents to the repository unless they specify a license. This file will be recognized by GitHub's automated license detection system, so it should not be modified in any way. --- LICENSE.txt | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 LICENSE.txt diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..0e259d4 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,121 @@ +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. From ffea159f4783c2fabeefdcaa02f2a10a778de62d Mon Sep 17 00:00:00 2001 From: Danielle Thurow Date: Tue, 25 May 2021 10:39:10 -0500 Subject: [PATCH 10/59] Update ArduinoISP.ino Updated an ArduinoISP.ino comment from "slave" to "target" to match the rest of the explanation in the comments. --- examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino b/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino index 4dec0c6..3f84d6b 100644 --- a/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino +++ b/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino @@ -33,7 +33,7 @@ // Put an LED (with resistor) on the following pins: // 9: Heartbeat - shows the programmer is running // 8: Error - Lights up if something goes wrong (use red if that makes sense) -// 7: Programming - In communication with the slave +// 7: Programming - In communication with the target // #include "Arduino.h" From 6e2916973f518ac699b7998821a6871b37822044 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 2 Aug 2021 11:42:31 -0700 Subject: [PATCH 11/59] Expand compilation workflow's paths filter to cover more irrelevant files The paths filter is used to make GitHub Actions workflows more efficient and contributor friendly by preventing pointless workflow runs from happening when only irrelevant files were modified. --- .github/workflows/compile-examples.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index c3f8074..5c3693a 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -16,13 +16,25 @@ name: Compile Examples on: pull_request: - paths: - - ".github/workflows/compile-examples.yml" - - "examples/**" + paths-ignore: + - "**" + - "!.github/workflows/compile-examples.ya?ml" + - "!examples/**" + - "**.adoc" + - "**.jpg" + - "**.md" + - "**.png" + - "**.txt" push: - paths: - - ".github/workflows/compile-examples.yml" - - "examples/**" + paths-ignore: + - "**" + - "!.github/workflows/compile-examples.ya?ml" + - "!examples/**" + - "**.adoc" + - "**.jpg" + - "**.md" + - "**.png" + - "**.txt" # Scheduled trigger checks for breakage caused by changes to external resources (libraries, platforms) schedule: # run every Tuesday at 3 AM UTC From 256ad33c7556adc7272d3ccdc8554493a5aaebc0 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 2 Aug 2021 12:19:30 -0700 Subject: [PATCH 12/59] Use modern action version in sketch compilation workflow The GitHub Actions action used to do a "smoke test" compilation of the examples has graduated from an "experimental" project to a stable state and been moved from its original home in the `arduino/actions` repository to a dedicated permanent home at `arduino/compile-sketches`. The copy in the previous repository is unmaintained and deprecated and its use results in a warning of such in the workflow run summary and logs. --- .github/workflows/compile-examples.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 5c3693a..232fba3 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -199,7 +199,7 @@ jobs: uses: actions/checkout@v2 - name: Compile examples - uses: arduino/actions/libraries/compile-examples@master + uses: arduino/compile-sketches@v1 with: fqbn: ${{ matrix.board.fqbn }} libraries: | From bad497757b75050606e028da2be4cfd9a806c0c7 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 2 Aug 2021 12:29:30 -0700 Subject: [PATCH 13/59] Use modern `arduino/compile-sketches` API The original API of the `arduino/compile-sketches` GitHub Actions action used by the "smoke test" sketch compilation workflow was based on Bash array-style space separated lists. This could not to advanced use cases and so a new approach of defining the data structures in YAML documents and then passing those to the action inputs was settled on. At the time the workflow was written, this had not yet been implemented for the `sketch-paths` input. The old API is now deprecated and so the workflow is here updated to the new API. --- .github/workflows/compile-examples.yml | 80 +++++++++++++------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 232fba3..cd265ea 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -58,30 +58,30 @@ jobs: - name: CapacitiveSensor # Sketch paths to compile (recursive) for all boards - UNIVERSAL_SKETCH_PATHS: >- - "examples/01.Basics" - "examples/02.Digital/BlinkWithoutDelay" - "examples/02.Digital/Button" - "examples/02.Digital/Debounce" - "examples/02.Digital/DigitalInputPullup" - "examples/02.Digital/StateChangeDetection" - "examples/03.Analog" - "examples/04.Communication/ASCIITable" - "examples/04.Communication/Dimmer" - "examples/04.Communication/Graph" - "examples/04.Communication/Midi" - "examples/04.Communication/PhysicalPixel" - "examples/04.Communication/ReadASCIIString" - "examples/04.Communication/SerialCallResponse" - "examples/04.Communication/SerialCallResponseASCII" - "examples/04.Communication/SerialEvent" - "examples/04.Communication/VirtualColorMixer" - "examples/05.Control" - "examples/06.Sensors/ADXL3xx" - "examples/06.Sensors/Knock" - "examples/07.Display" - "examples/08.Strings" - "examples/11.ArduinoISP" + UNIVERSAL_SKETCH_PATHS: | + - examples/01.Basics + - examples/02.Digital/BlinkWithoutDelay + - examples/02.Digital/Button + - examples/02.Digital/Debounce + - examples/02.Digital/DigitalInputPullup + - examples/02.Digital/StateChangeDetection + - examples/03.Analog + - examples/04.Communication/ASCIITable + - examples/04.Communication/Dimmer + - examples/04.Communication/Graph + - examples/04.Communication/Midi + - examples/04.Communication/PhysicalPixel + - examples/04.Communication/ReadASCIIString + - examples/04.Communication/SerialCallResponse + - examples/04.Communication/SerialCallResponseASCII + - examples/04.Communication/SerialEvent + - examples/04.Communication/VirtualColorMixer + - examples/05.Control + - examples/06.Sensors/ADXL3xx + - examples/06.Sensors/Knock + - examples/07.Display + - examples/08.Strings + - examples/11.ArduinoISP strategy: fail-fast: false @@ -153,8 +153,8 @@ jobs: - name: Keyboard - name: Mouse # Compile these sketches in addition to the ones defined by env.UNIVERSAL_SKETCH_PATHS - usb-sketch-paths: >- - "examples/09.USB" + usb-sketch-paths: | + - examples/09.USB - board: usb: false usb-libraries: "" @@ -162,34 +162,34 @@ jobs: - board: # Boards with a Serial1 port serial1: true - serial1-sketch-paths: >- - "examples/04.Communication/MultiSerial" - "examples/04.Communication/SerialPassthrough" + serial1-sketch-paths: | + - examples/04.Communication/MultiSerial + - examples/04.Communication/SerialPassthrough - board: serial1: false serial1-sketch-paths: "" - board: starter-kit: true - starter-kit-sketch-paths: >- - "examples/10.StarterKit_BasicKit" + starter-kit-sketch-paths: | + - examples/10.StarterKit_BasicKit - board: starter-kit: false starter-kit-sketch-paths: "" - board: tone: true - tone-sketch-paths: >- - "examples/02.Digital/toneKeyboard" - "examples/02.Digital/toneMelody" - "examples/02.Digital/toneMultiple" - "examples/02.Digital/tonePitchFollower" + tone-sketch-paths: | + - examples/02.Digital/toneKeyboard + - examples/02.Digital/toneMelody + - examples/02.Digital/toneMultiple + - examples/02.Digital/tonePitchFollower - board: tone: false tone-sketch-paths: "" - board: pulsein: true - pulsein-sketch-paths: >- - "examples/06.Sensors/Memsic2125" - "examples/06.Sensors/Ping" + pulsein-sketch-paths: | + - examples/06.Sensors/Memsic2125 + - examples/06.Sensors/Ping - board: pulsein: false pulsein-sketch-paths: "" @@ -205,7 +205,7 @@ jobs: libraries: | ${{ env.UNIVERSAL_LIBRARIES }} ${{ matrix.usb-libraries }} - sketch-paths: >- + sketch-paths: | ${{ env.UNIVERSAL_SKETCH_PATHS }} ${{ matrix.usb-sketch-paths }} ${{ matrix.serial1-sketch-paths }} From c66e55c5492d0d902c58249757bdc6e481b9e384 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 2 Aug 2021 12:57:38 -0700 Subject: [PATCH 14/59] Use modern board-specific Mbed OS Boards platforms Since the time the workflow was written, the "Arduino Mbed OS Boards" platform was split into a variant for each of the boards "families" supported by that platform. The benefit of this split is a reduction of installation and compilation times. The previous `arduino:mbed` platform is still available to ease the transition to the new platforms, but it is deprecated. --- .github/workflows/compile-examples.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index cd265ea..60bd691 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -120,13 +120,13 @@ jobs: starter-kit: false tone: true pulsein: true - - fqbn: arduino:mbed:nano33ble + - fqbn: arduino:mbed_nano:nano33ble usb: false serial1: true starter-kit: false tone: true pulsein: true - - fqbn: arduino:mbed:envie_m7 + - fqbn: arduino:mbed_portenta:envie_m7 usb: false serial1: true starter-kit: false From 759c03b4ff1f3151e54912e631df4dd584cd6bb9 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 2 Aug 2021 13:21:41 -0700 Subject: [PATCH 15/59] Use FQBN for sketch compilation workflow job names The "Compile Examples" workflow used to do a "smoke test" sketch compilation CI check uses a job matrix to compile the sketches for all boards of interest. By default, the matrix job is named by the matrix element for that job. This element includes board data used to make board-specific job customizations. That attribute data makes the job name, which is used to identify it in the checks status UI and workflow logs, fairly cryptic. The only information of interest to a human identifying the job is the FQBN. Defining a custom job name overrides the default job naming behavior. --- .github/workflows/compile-examples.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 60bd691..c86ff0e 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -48,6 +48,7 @@ on: jobs: build: + name: ${{ matrix.board.fqbn }} runs-on: ubuntu-latest env: From 9b2ba95c6f3ffccd830dc44dcc585efe726bfd17 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 2 Aug 2021 14:02:14 -0700 Subject: [PATCH 16/59] Enable `pulseIn()` sketches for Portenta in sketch compilation workflow At the time the "Compile Examples" CI workflow was written, the Portenta H7 board did not have a `pulseIn()` function. Although this was a legitimate bug, since this was an issue with the `arduino/ArduinoCore-mbed` code base, already tracked there, and unrelated to the code hosted in this repository, it was determined that the best approach would be to configure the workflow to not compile the examples that used `pulseIn()` for the Portenta H7. Since that time, `pulseIn()` has been implemented for Portenta H7 and so we can now compile these sketches for that board. --- .github/workflows/compile-examples.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index c86ff0e..7785ed3 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -132,9 +132,7 @@ jobs: serial1: true starter-kit: false tone: true - # Bug report: https://github.com/arduino/ArduinoCore-mbed/issues/48 - # Change the value to true once it is fixed. - pulsein: false + pulsein: true - fqbn: arduino:sam:arduino_due_x usb: true serial1: true From 3cf1130db227c1ea924565b37066109b50ac88cf Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 2 Aug 2021 14:07:49 -0700 Subject: [PATCH 17/59] Remove "pulsein" board attribute from "Compile Examples" CI workflow This attribute was used to configure the workflow to skip compilation of examples that used `pulseIn()` for boards that were already known to not provide this functionality. The only such board was the Portenta H7 and that has since gained a `pulseIn()`. Since all boards now have `pulseIn()`, the attribute no longer serves a purpose and can be removed from the workflow. --- .github/workflows/compile-examples.yml | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 7785ed3..a62d862 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -78,8 +78,7 @@ jobs: - examples/04.Communication/SerialEvent - examples/04.Communication/VirtualColorMixer - examples/05.Control - - examples/06.Sensors/ADXL3xx - - examples/06.Sensors/Knock + - examples/06.Sensors - examples/07.Display - examples/08.Strings - examples/11.ArduinoISP @@ -95,44 +94,37 @@ jobs: serial1: false starter-kit: true tone: true - pulsein: true # Adding this in addition to the Uno because it has 1.5 kB less available flash - fqbn: arduino:avr:nano usb: false serial1: false starter-kit: false tone: true - pulsein: true - fqbn: arduino:avr:leonardo usb: true serial1: true starter-kit: false tone: true - pulsein: true - fqbn: arduino:megaavr:uno2018:mode=off usb: false serial1: true starter-kit: false tone: true - pulsein: true - fqbn: arduino:samd:mkrzero usb: true serial1: true starter-kit: false tone: true - pulsein: true - fqbn: arduino:mbed_nano:nano33ble usb: false serial1: true starter-kit: false tone: true - pulsein: true - fqbn: arduino:mbed_portenta:envie_m7 usb: false serial1: true starter-kit: false tone: true - pulsein: true - fqbn: arduino:sam:arduino_due_x usb: true serial1: true @@ -140,7 +132,6 @@ jobs: # Bug report: https://github.com/arduino/ArduinoCore-sam/issues/24 # Change the value to true once it is fixed. tone: false - pulsein: true # Make board type-specific customizations to the matrix jobs include: @@ -184,14 +175,6 @@ jobs: - board: tone: false tone-sketch-paths: "" - - board: - pulsein: true - pulsein-sketch-paths: | - - examples/06.Sensors/Memsic2125 - - examples/06.Sensors/Ping - - board: - pulsein: false - pulsein-sketch-paths: "" steps: - name: Checkout @@ -210,4 +193,3 @@ jobs: ${{ matrix.serial1-sketch-paths }} ${{ matrix.starter-kit-sketch-paths }} ${{ matrix.tone-sketch-paths }} - ${{ matrix.pulsein-sketch-paths }} From decf6b4d53c27925e629ac466f3604f61ad53156 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 2 Aug 2021 14:44:25 -0700 Subject: [PATCH 18/59] Add Nano RP2040 Connect to sketch compilation CI workflow --- .github/workflows/compile-examples.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index a62d862..e11dd44 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -120,6 +120,11 @@ jobs: serial1: true starter-kit: false tone: true + - fqbn: arduino:mbed_nano:nanorp2040connect + usb: false + serial1: true + starter-kit: false + tone: true - fqbn: arduino:mbed_portenta:envie_m7 usb: false serial1: true From 3a7280102c976a9b2fa0b887dc76112e59946dc1 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 2 Aug 2021 18:13:42 -0700 Subject: [PATCH 19/59] Configure "Compile Examples" workflow to skip incompatible sketch/board combo Pin A5 is used by the "StringComparisonOperators" example. The Nano RP2040 Connect uses the u-blox NINA-W102's ADC for pins A4-A7. This means those pins are only usable in a sketch when it contains an `#include` directive for the WiFiNINA library. This results in compilation of that example failing for the Nano RP 2040 Connect. The need for this `#include` directive is surely an intentional design decision, and thus not likely to change. Although it is possible to add compatibility to the sketch with a preprocessor conditional, the added complexity in what is intended to be a very beginner friendly example is likely not worth it. Another option would be to change the sketch to use a different pin, but that sort of change does not fall within my remit. The error message the user will experience if they attempt to compile this sketch for their board is reasonably good so I suppose the realistic best way forward is to consider this not a bug and just skip the sketch. --- .github/workflows/compile-examples.yml | 31 +++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index e11dd44..048258d 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -80,7 +80,19 @@ jobs: - examples/05.Control - examples/06.Sensors - examples/07.Display - - examples/08.Strings + - examples/08.Strings/CharacterAnalysis + - examples/08.Strings/StringAdditionOperator + - examples/08.Strings/StringAppendOperator + - examples/08.Strings/StringCaseChanges + - examples/08.Strings/StringCharacters + - examples/08.Strings/StringConstructors + - examples/08.Strings/StringIndexOf + - examples/08.Strings/StringLength + - examples/08.Strings/StringLengthTrim + - examples/08.Strings/StringReplace + - examples/08.Strings/StringStartsWithEndsWith + - examples/08.Strings/StringSubstring + - examples/08.Strings/StringToInt - examples/11.ArduinoISP strategy: @@ -94,42 +106,51 @@ jobs: serial1: false starter-kit: true tone: true + a5: true # Adding this in addition to the Uno because it has 1.5 kB less available flash - fqbn: arduino:avr:nano usb: false serial1: false starter-kit: false tone: true + a5: true - fqbn: arduino:avr:leonardo usb: true serial1: true starter-kit: false tone: true + a5: true - fqbn: arduino:megaavr:uno2018:mode=off usb: false serial1: true starter-kit: false tone: true + a5: true - fqbn: arduino:samd:mkrzero usb: true serial1: true starter-kit: false tone: true + a5: true - fqbn: arduino:mbed_nano:nano33ble usb: false serial1: true starter-kit: false tone: true + a5: true - fqbn: arduino:mbed_nano:nanorp2040connect usb: false serial1: true starter-kit: false tone: true + # WiFiNINA library is required to use pins A4-A7. + a5: false - fqbn: arduino:mbed_portenta:envie_m7 usb: false serial1: true starter-kit: false tone: true + a5: true - fqbn: arduino:sam:arduino_due_x usb: true serial1: true @@ -137,6 +158,7 @@ jobs: # Bug report: https://github.com/arduino/ArduinoCore-sam/issues/24 # Change the value to true once it is fixed. tone: false + a5: true # Make board type-specific customizations to the matrix jobs include: @@ -180,6 +202,13 @@ jobs: - board: tone: false tone-sketch-paths: "" + - board: + a5: true + a5-sketch-paths: | + - examples/08.Strings/StringComparisonOperators + - board: + a5: false + tone-sketch-paths: "" steps: - name: Checkout From 2dcf0a5ba77e16013c0903bf74590fcc4d869b93 Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 19 Oct 2021 23:55:45 -0700 Subject: [PATCH 20/59] Add GitHub Actions workflow to synchronize with shared repository labels On every push that changes relevant files, and periodically, configure the repository's issue and pull request labels according to the universal, shared, and local label configuration files. --- .github/workflows/sync-labels.yml | 138 ++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 .github/workflows/sync-labels.yml diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml new file mode 100644 index 0000000..fe53570 --- /dev/null +++ b/.github/workflows/sync-labels.yml @@ -0,0 +1,138 @@ +# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/sync-labels.md +name: Sync Labels + +# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows +on: + push: + paths: + - ".github/workflows/sync-labels.ya?ml" + - ".github/label-configuration-files/*.ya?ml" + pull_request: + paths: + - ".github/workflows/sync-labels.ya?ml" + - ".github/label-configuration-files/*.ya?ml" + schedule: + # Run daily at 8 AM UTC to sync with changes to shared label configurations. + - cron: "0 8 * * *" + workflow_dispatch: + repository_dispatch: + +env: + CONFIGURATIONS_FOLDER: .github/label-configuration-files + CONFIGURATIONS_ARTIFACT: label-configuration-files + +jobs: + check: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Download JSON schema for labels configuration file + id: download-schema + uses: carlosperate/download-file-action@v1.0.3 + with: + file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/arduino-tooling-gh-label-configuration-schema.json + location: ${{ runner.temp }}/label-configuration-schema + + - name: Install JSON schema validator + run: | + sudo npm install \ + --global \ + ajv-cli \ + ajv-formats + + - name: Validate local labels configuration + run: | + # See: https://github.com/ajv-validator/ajv-cli#readme + ajv validate \ + --all-errors \ + -c ajv-formats \ + -s "${{ steps.download-schema.outputs.file-path }}" \ + -d "${{ env.CONFIGURATIONS_FOLDER }}/*.{yml,yaml}" + + download: + needs: check + runs-on: ubuntu-latest + + strategy: + matrix: + filename: + # Filenames of the shared configurations to apply to the repository in addition to the local configuration. + # https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/sync-labels + - universal.yml + + steps: + - name: Download + uses: carlosperate/download-file-action@v1.0.3 + with: + file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }} + + - name: Pass configuration files to next job via workflow artifact + uses: actions/upload-artifact@v2 + with: + path: | + *.yaml + *.yml + if-no-files-found: error + name: ${{ env.CONFIGURATIONS_ARTIFACT }} + + sync: + needs: download + runs-on: ubuntu-latest + + steps: + - name: Set environment variables + run: | + # See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable + echo "MERGED_CONFIGURATION_PATH=${{ runner.temp }}/labels.yml" >> "$GITHUB_ENV" + + - name: Determine whether to dry run + id: dry-run + if: > + github.event_name == 'pull_request' || + ( + ( + github.event_name == 'push' || + github.event_name == 'workflow_dispatch' + ) && + github.ref != format('refs/heads/{0}', github.event.repository.default_branch) + ) + run: | + # Use of this flag in the github-label-sync command will cause it to only check the validity of the + # configuration. + echo "::set-output name=flag::--dry-run" + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Download configuration files artifact + uses: actions/download-artifact@v2 + with: + name: ${{ env.CONFIGURATIONS_ARTIFACT }} + path: ${{ env.CONFIGURATIONS_FOLDER }} + + - name: Remove unneeded artifact + uses: geekyeggo/delete-artifact@v1 + with: + name: ${{ env.CONFIGURATIONS_ARTIFACT }} + + - name: Merge label configuration files + run: | + # Merge all configuration files + shopt -s extglob + cat "${{ env.CONFIGURATIONS_FOLDER }}"/*.@(yml|yaml) > "${{ env.MERGED_CONFIGURATION_PATH }}" + + - name: Install github-label-sync + run: sudo npm install --global github-label-sync + + - name: Sync labels + env: + GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # See: https://github.com/Financial-Times/github-label-sync + github-label-sync \ + --labels "${{ env.MERGED_CONFIGURATION_PATH }}" \ + ${{ steps.dry-run.outputs.flag }} \ + ${{ github.repository }} From 20a5c62947d41261d068e16607b9be62ac683cbe Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 3 May 2022 21:31:46 -0700 Subject: [PATCH 21/59] Configure Dependabot to check for outdated actions used in workflows Dependabot will periodically check the versions of all actions used in the repository's workflows. If any are found to be outdated, it will submit a pull request to update them. NOTE: Dependabot's PRs will occasionally propose to pin to the patch version of the action (e.g., updating `uses: foo/bar@v1` to `uses: foo/bar@v2.3.4`). When the action author has provided a major version ref, use that instead (e.g., `uses: foo/bar@v2`). Dependabot will automatically close its PR once the workflow has been updated. More information: https://docs.github.com/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot --- .github/dependabot.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..fd7388a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +# See: https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#about-the-dependabotyml-file +version: 2 + +updates: + # Configure check for outdated GitHub Actions actions in workflows. + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/dependabot/README.md + # See: https://docs.github.com/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot + - package-ecosystem: github-actions + directory: / # Check the repository's workflows under /.github/workflows/ + schedule: + interval: daily + labels: + - "topic: infrastructure" From 052dd5ff6c4064aabdc31aac1d33357ca177014f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 May 2022 07:48:45 +0000 Subject: [PATCH 22/59] Bump actions/checkout from 2 to 3 Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/code-formatting-check.yml | 2 +- .github/workflows/compile-examples.yml | 2 +- .github/workflows/spell-check.yml | 2 +- .github/workflows/sync-labels.yml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/code-formatting-check.yml b/.github/workflows/code-formatting-check.yml index fe28659..4fc4a6b 100644 --- a/.github/workflows/code-formatting-check.yml +++ b/.github/workflows/code-formatting-check.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 # See: http://astyle.sourceforge.net/ - name: Download Artistic Style diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 048258d..646db49 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -212,7 +212,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Compile examples uses: arduino/compile-sketches@v1 diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml index b53bc44..6a382c5 100644 --- a/.github/workflows/spell-check.yml +++ b/.github/workflows/spell-check.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 # See: https://github.com/codespell-project/actions-codespell/blob/master/README.md - name: Spell check diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index fe53570..b63271c 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -27,7 +27,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Download JSON schema for labels configuration file id: download-schema @@ -105,7 +105,7 @@ jobs: echo "::set-output name=flag::--dry-run" - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Download configuration files artifact uses: actions/download-artifact@v2 From 587b4ed9574f720dcbb9bfcdeed23b695bf67d8c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 May 2022 07:48:47 +0000 Subject: [PATCH 23/59] Bump actions/download-artifact from 2 to 3 Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 2 to 3. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/sync-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index fe53570..d4aea85 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -108,7 +108,7 @@ jobs: uses: actions/checkout@v2 - name: Download configuration files artifact - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: ${{ env.CONFIGURATIONS_ARTIFACT }} path: ${{ env.CONFIGURATIONS_FOLDER }} From 1ef2a53cc068e68007600dd234974814566f0a7c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 May 2022 07:48:52 +0000 Subject: [PATCH 24/59] Bump actions/upload-artifact from 2 to 3 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/sync-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index fe53570..e3d6327 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -70,7 +70,7 @@ jobs: file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }} - name: Pass configuration files to next job via workflow artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: path: | *.yaml From b7068a6b6aaebe8212fc925a33f8bcd7d277a765 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 May 2022 07:48:52 +0000 Subject: [PATCH 25/59] Bump carlosperate/download-file-action from 1.0.3 to 1.1.1 Bumps [carlosperate/download-file-action](https://github.com/carlosperate/download-file-action) from 1.0.3 to 1.1.1. - [Release notes](https://github.com/carlosperate/download-file-action/releases) - [Commits](https://github.com/carlosperate/download-file-action/compare/v1.0.3...v1.1.1) --- updated-dependencies: - dependency-name: carlosperate/download-file-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/code-formatting-check.yml | 2 +- .github/workflows/sync-labels.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/code-formatting-check.yml b/.github/workflows/code-formatting-check.yml index fe28659..6533394 100644 --- a/.github/workflows/code-formatting-check.yml +++ b/.github/workflows/code-formatting-check.yml @@ -24,7 +24,7 @@ jobs: # See: http://astyle.sourceforge.net/ - name: Download Artistic Style - uses: carlosperate/download-file-action@v1.0.3 + uses: carlosperate/download-file-action@v1.1.1 with: file-url: https://iweb.dl.sourceforge.net/project/astyle/astyle/astyle%20${{ env.ASTYLE_VERSION }}/astyle_${{ env.ASTYLE_VERSION }}_linux.tar.gz location: ${{ runner.temp }}/astyle diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index fe53570..a32d73e 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -31,7 +31,7 @@ jobs: - name: Download JSON schema for labels configuration file id: download-schema - uses: carlosperate/download-file-action@v1.0.3 + uses: carlosperate/download-file-action@v1.1.1 with: file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/arduino-tooling-gh-label-configuration-schema.json location: ${{ runner.temp }}/label-configuration-schema @@ -65,7 +65,7 @@ jobs: steps: - name: Download - uses: carlosperate/download-file-action@v1.0.3 + uses: carlosperate/download-file-action@v1.1.1 with: file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }} From 5c6f07e5f7a9944fa95f373be78211779688f27f Mon Sep 17 00:00:00 2001 From: per1234 Date: Wed, 4 May 2022 01:51:01 -0700 Subject: [PATCH 26/59] Use major version ref of `carlosperate/download-file-action` The `carlosperate/download-file-action` action is used in the GitHub Actions workflows as a convenient way to download external resources. A major version ref has been added to that repository. It will always point to the latest release of the "1" major version series. This means it is no longer necessary to do a full pin of the action version in use as before. Use of the major version ref will cause the workflow to use a stable version of the action, while also benefiting from ongoing development to the action up until such time as a new major release of an action is made. At that time we would need to evaluate whether any changes to the workflow are required by the breaking change that triggered the major release before manually updating the major ref (e.g., uses: `carlosperate/download-file-action@v2`). I think this approach strikes the right balance between stability and maintainability for these workflows. --- .github/workflows/code-formatting-check.yml | 2 +- .github/workflows/sync-labels.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/code-formatting-check.yml b/.github/workflows/code-formatting-check.yml index 6533394..d8843f1 100644 --- a/.github/workflows/code-formatting-check.yml +++ b/.github/workflows/code-formatting-check.yml @@ -24,7 +24,7 @@ jobs: # See: http://astyle.sourceforge.net/ - name: Download Artistic Style - uses: carlosperate/download-file-action@v1.1.1 + uses: carlosperate/download-file-action@v1 with: file-url: https://iweb.dl.sourceforge.net/project/astyle/astyle/astyle%20${{ env.ASTYLE_VERSION }}/astyle_${{ env.ASTYLE_VERSION }}_linux.tar.gz location: ${{ runner.temp }}/astyle diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index a32d73e..3ee6feb 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -31,7 +31,7 @@ jobs: - name: Download JSON schema for labels configuration file id: download-schema - uses: carlosperate/download-file-action@v1.1.1 + uses: carlosperate/download-file-action@v1 with: file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/arduino-tooling-gh-label-configuration-schema.json location: ${{ runner.temp }}/label-configuration-schema @@ -65,7 +65,7 @@ jobs: steps: - name: Download - uses: carlosperate/download-file-action@v1.1.1 + uses: carlosperate/download-file-action@v1 with: file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }} From ae0147c286a423019875bb8520065b4316b44664 Mon Sep 17 00:00:00 2001 From: per1234 Date: Wed, 11 May 2022 09:21:09 -0700 Subject: [PATCH 27/59] Use form-based issue templates High quality feedback via GitHub issues is a very valuable contribution to the project. It is important to make the issue creation and management process as efficient as possible for the contributors, maintainers, and developers. Issue templates are helpful to the maintainers and developers because it establishes a standardized framework for the issues and encourages the contributors to provide the essential information. The contributor is now presented with a web form when creating an issue. This consists of multi-line input fields that have the same formatting, preview, and attachment capabilities as the standard GitHub Issue composer, in addition to menus and checkboxes where appropriate. The use of this form-based system should provide a much better experience for the contributors and also result in higher quality issues by establishing a standardized framework for the issues and encouraging contributors to provide the essential information. A template chooser allows the contributor to select the appropriate template type, redirects support requests to the appropriate communication channels via "Contact Links", and provides a prominent link to security policy to guide any vulnerability disclosures. The clear separation of the types of issues encourages the reporter to fit their report into a specific issue category, resulting in more clarity. Automatic labeling according to template choice allows the reporter to do the initial classification. --- .github/ISSUE_TEMPLATE/bug-report.yml | 56 ++++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 14 ++++++ .github/ISSUE_TEMPLATE/feature-request.yml | 51 ++++++++++++++++++++ 3 files changed, 121 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug-report.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature-request.yml diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml new file mode 100644 index 0000000..f538bc8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -0,0 +1,56 @@ +# Source: https://github.com/arduino/tooling-project-assets/blob/main/issue-templates/forms/general/bug-report.yml +# See: https://docs.github.com/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms + +name: Bug report +description: Report a problem with the code or documentation in this repository. +labels: + - "type: imperfection" +body: + - type: textarea + id: description + attributes: + label: Describe the problem + validations: + required: true + - type: textarea + id: reproduce + attributes: + label: To reproduce + description: Provide the specific set of steps we can follow to reproduce the problem. + validations: + required: true + - type: textarea + id: expected + attributes: + label: Expected behavior + description: What would you expect to happen after following those instructions? + validations: + required: true + - type: input + id: project-version + attributes: + label: The examples version + description: | + Which version of the "built-in examples" are you using? + _This should be the most recent version available._ + validations: + required: true + - type: textarea + id: additional + attributes: + label: Additional context + description: Add any additional information here. + validations: + required: false + - type: checkboxes + id: checklist + attributes: + label: Issue checklist + description: Please double-check that you have done each of the following things before submitting the issue. + options: + - label: I searched for previous reports in [the issue tracker](https://github.com/arduino/arduino-examples/issues?q=) + required: true + - label: I verified the problem still occurs when using the latest version + required: true + - label: My report contains all necessary details + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..cfceab5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,14 @@ +# Source: https://github.com/arduino/tooling-project-assets/blob/main/issue-templates/template-choosers/general/config.yml +# See: https://docs.github.com/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser + +blank_issues_enabled: false +contact_links: + - name: Learn about using this project + url: https://github.com/arduino/arduino-examples#readme + about: Detailed usage documentation is available here. + - name: Support request + url: https://forum.arduino.cc/ + about: We can help you out on the Arduino Forum! + - name: Discuss development work on the project + url: https://groups.google.com/a/arduino.cc/g/developers + about: Arduino Developers Mailing List diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml new file mode 100644 index 0000000..bd22292 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -0,0 +1,51 @@ +# Source: https://github.com/arduino/tooling-project-assets/blob/main/issue-templates/forms/general/bug-report.yml +# See: https://docs.github.com/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms + +name: Feature request +description: Suggest an enhancement to this project. +labels: + - "type: enhancement" +body: + - type: textarea + id: description + attributes: + label: Describe the request + validations: + required: true + - type: textarea + id: current + attributes: + label: Describe the current behavior + description: | + What is the current behavior of the project in relation to your request? + How can we reproduce that behavior? + validations: + required: true + - type: input + id: project-version + attributes: + label: The examples version + description: | + Which version of the "built-in examples" are you using? + _This should be the most recent version available._ + validations: + required: true + - type: textarea + id: additional + attributes: + label: Additional context + description: Add any additional information here. + validations: + required: false + - type: checkboxes + id: checklist + attributes: + label: Issue checklist + description: Please double-check that you have done each of the following things before submitting the issue. + options: + - label: I searched for previous requests in [the issue tracker](https://github.com/arduino/arduino-examples/issues?q=) + required: true + - label: I verified the feature was still missing when using the latest version + required: true + - label: My request contains all necessary details + required: true From 639da94e542285f46480ab46bdb6641835a4a91f Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 3 Oct 2022 00:38:17 -0700 Subject: [PATCH 28/59] Break code formatting command into multiple lines A script included in the repository formats the code in the examples according to Arduino's standard style. Since the formatter tool does not have a recursive capability, `find` must be used. This results in a fairly long and complex command. Adding line breaks to split the command into its individual arguments, with indentation to indicate the structure of these arguments makes the command easier to understand. --- examples_formatter.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/examples_formatter.sh b/examples_formatter.sh index b331e55..b13e80d 100755 --- a/examples_formatter.sh +++ b/examples_formatter.sh @@ -1,2 +1,10 @@ # you need to have astyle installed before running this -find examples -regextype posix-extended -regex '.*\.((ino)|(h)|(cpp)|(c))$' -and -type f -exec astyle --options=examples_formatter.conf {} \; +find \ + examples \ + -regextype posix-extended \ + -regex '.*\.((ino)|(h)|(cpp)|(c))$' -and \ + -type f \ + -exec \ + astyle \ + --options=examples_formatter.conf \ + {} \; From 8e1ec355e4bc9558997e0edc4f94ca9c9ef1c8e6 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 3 Oct 2022 01:03:26 -0700 Subject: [PATCH 29/59] Use globbing for extension mapping in formatting script The repository includes a script that formats the example sketch code. This uses a `find` command to recurse through the example folders and run the formatter on each file with a relevant extension. Previously a regular expression was used for that matching. Although perfectly functional, the same can be achieved in an easier to understand and maintain manner using globs. --- examples_formatter.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples_formatter.sh b/examples_formatter.sh index b13e80d..3962693 100755 --- a/examples_formatter.sh +++ b/examples_formatter.sh @@ -1,8 +1,12 @@ # you need to have astyle installed before running this find \ examples \ - -regextype posix-extended \ - -regex '.*\.((ino)|(h)|(cpp)|(c))$' -and \ + \( \ + -name '*.c' -or \ + -name '*.cpp' -or \ + -name '*.h' -or \ + -name '*.ino' \ + \) \ -type f \ -exec \ astyle \ From dac0093581e24a5922f213c61b16b90dbf9c5d2b Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 3 Oct 2022 01:10:59 -0700 Subject: [PATCH 30/59] Add additional supported file extensions to formatter script The `.ipp` and `.tpp` file extensions, commonly used for inline or template function definitions included in C++ header files, have now been added to the Arduino sketch specification as supported extensions. Even though it is unlikely such extensions will ever be used in the example sketches of this repository, it is best to be comprehensive in the extensions covered by the formatter script --- examples_formatter.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples_formatter.sh b/examples_formatter.sh index 3962693..9be18d6 100755 --- a/examples_formatter.sh +++ b/examples_formatter.sh @@ -5,7 +5,9 @@ find \ -name '*.c' -or \ -name '*.cpp' -or \ -name '*.h' -or \ - -name '*.ino' \ + -name '*.ino' -or \ + -name '*.ipp' -or \ + -name '*.tpp' \ \) \ -type f \ -exec \ From 124bead96f027141dc6a88991ed5cc139e08a1dd Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 3 Oct 2022 01:24:57 -0700 Subject: [PATCH 31/59] Make formatter script check availability of tool The repository includes a script that formats the code in the examples. When running this script locally, the contributor must have the formatter tool installed and in the system PATH. Previously this dependency was only explained by a comment in the script, which is not likely to be seen by the contributor in advance of running it. This means they would encounter a somewhat cryptic error message. A more contributor friendly approach is for the script to check for the availability of the tool, then exit with a friendly error message if it is not found. --- examples_formatter.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples_formatter.sh b/examples_formatter.sh index 9be18d6..475c2a4 100755 --- a/examples_formatter.sh +++ b/examples_formatter.sh @@ -1,4 +1,8 @@ -# you need to have astyle installed before running this +if ! which astyle &>/dev/null; then + echo "astyle not found or not in PATH. Please install: https://astyle.sourceforge.net/install.html" + exit 1 +fi + find \ examples \ \( \ From 6b637006f4b531733a15ee79fe6fbaa665bb1566 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 3 Oct 2022 03:38:18 -0700 Subject: [PATCH 32/59] Use formatter script in CI workflow The repository includes a script that formats the code in the example sketches. Previously, this script was only provided to make it easy for contributors to achieve compliant code formatting while preparing a pull request. In addition to this effort to facilitate compliance, enforcement is implemented by a GitHub Actions workflow. Since the formatter tool does not have the directory tree recursion capability needed to process all the files in the repository, it is necessary to implement such capability using a `find` command. Previously this was done both in the script and the workflow. `find` is ridiculously complex and unintuitive, prone to confusing bugs. For this reason, it will be best to avoid maintaining redundant code for recursing through the example code files. This is accomplished by simply running the script from the workflow. Even though the two have different goals (making formatting compliant vs checking whether formatting is compliant), the two are easily aligned by formatting the files in the workflow, then checking for a diff. This approach has been widely used in other Arduino Tooling Team formatting check workflows and I find the diff is very effective at communicating which changes are required, likely more so than the approach previously used in the workflow. --- .github/workflows/code-formatting-check.yml | 29 ++++++++------------- 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/.github/workflows/code-formatting-check.yml b/.github/workflows/code-formatting-check.yml index 351099b..9935758 100644 --- a/.github/workflows/code-formatting-check.yml +++ b/.github/workflows/code-formatting-check.yml @@ -4,10 +4,12 @@ on: pull_request: paths: - ".github/workflows/code-formatting-check.yml" + - "examples_formatter.sh" - "examples/**" push: paths: - ".github/workflows/code-formatting-check.yml" + - "examples_formatter.sh" - "examples/**" jobs: @@ -37,27 +39,18 @@ jobs: tar --extract --file="astyle_${{ env.ASTYLE_VERSION }}_linux.tar.gz" cd "astyle/build/gcc" make + # Add installation to PATH: + # See: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path + echo "${{ runner.temp }}/astyle/astyle/build/gcc/bin" >> "$GITHUB_PATH" - # GITHUB_WORKSPACE - - name: Check code formatting + - name: Format examples + run: ./examples_formatter.sh + + - name: Check formatting run: | - # Check code formatting of example sketches - # Don't exit on first formatting check fail - set +e - # Set default exit status - EXIT_STATUS=0 - while read -r filePath; do - # Check if it's a file (find matches on pruned folders) - if [[ -f "$filePath" ]]; then - if ! diff --strip-trailing-cr "$filePath" <("${{ runner.temp }}/astyle/astyle/build/gcc/bin/astyle" --options="${GITHUB_WORKSPACE}/examples_formatter.conf" --dry-run <"$filePath"); then - echo "ERROR: Non-compliant code formatting in $filePath" - EXIT_STATUS=1 - fi - fi - done <<<"$(find "${GITHUB_WORKSPACE}/examples" -regextype posix-extended \( -regex '.*\.((ino)|(h)|(cpp)|(c))$' -and -type f \))" - if [[ "$EXIT_STATUS" != "0" ]]; then + if ! git diff --color --exit-code; then echo "Please do an Auto Format on the sketches:" echo "Arduino IDE: Tools > Auto Format" echo "Arduino Web Editor: Ctrl + B" + exit 1 fi - exit "$EXIT_STATUS" From 948bcf861bad9298be43c1ea4583609ceee79d6f Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 3 Oct 2022 04:34:54 -0700 Subject: [PATCH 33/59] Trigger formatting check workflow on changes to formatter configuration For the sake of efficiency, the repository's GitHub Actions workflows are configured to only run when relevant files are modified. The formatter configuration file is one such file, yet was previously omitted from the paths filter. --- .github/workflows/code-formatting-check.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/code-formatting-check.yml b/.github/workflows/code-formatting-check.yml index 9935758..76781b9 100644 --- a/.github/workflows/code-formatting-check.yml +++ b/.github/workflows/code-formatting-check.yml @@ -4,11 +4,13 @@ on: pull_request: paths: - ".github/workflows/code-formatting-check.yml" + - "examples_formatter.conf" - "examples_formatter.sh" - "examples/**" push: paths: - ".github/workflows/code-formatting-check.yml" + - "examples_formatter.conf" - "examples_formatter.sh" - "examples/**" From f10994278c11fd3c2c138d0455a898d317907c38 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 3 Oct 2022 04:47:47 -0700 Subject: [PATCH 34/59] Update download URL for Artistic Style in formatting check workflow --- .github/workflows/code-formatting-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code-formatting-check.yml b/.github/workflows/code-formatting-check.yml index 76781b9..98a09e2 100644 --- a/.github/workflows/code-formatting-check.yml +++ b/.github/workflows/code-formatting-check.yml @@ -30,7 +30,7 @@ jobs: - name: Download Artistic Style uses: carlosperate/download-file-action@v1 with: - file-url: https://iweb.dl.sourceforge.net/project/astyle/astyle/astyle%20${{ env.ASTYLE_VERSION }}/astyle_${{ env.ASTYLE_VERSION }}_linux.tar.gz + file-url: https://cfhcable.dl.sourceforge.net/project/astyle/astyle/astyle%20${{ env.ASTYLE_VERSION }}/astyle_${{ env.ASTYLE_VERSION }}_linux.tar.gz location: ${{ runner.temp }}/astyle # See: http://astyle.sourceforge.net/install.html#_GCC_Makefile From 4bbbf5c13a3c40e4435c9e659247e5fcbad2c3e6 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 3 Oct 2022 05:19:15 -0700 Subject: [PATCH 35/59] Use ClangFormat as code formatter for examples The code formatting tool used by the Arduino IDE 1.x "Auto Format" feature is "Artistic Style". This was changed to ClangFormat in Arduino IDE 2.x. Now that the stable Arduino IDE 2.0.0 release has been made, this is now the official code formatting tool for use with Arduino sketches. Due to differences in the two tools, some unavoidable minor changes occurred in the formatting style. This meant that the Arduino IDE 2.x user may experience some unexpected changes to the unmodified official example sketches when running an "Auto Format". So the examples in this repository must be formatted to comply with the updated Arduino code style. The changes are mostly the result of ClangFormat being more "opinionated" than "Artistic Style" was under the fairly light-handed formatter configuration used by Arduino IDE 1.x Auto Format. Due to this factor, formatting changes required to bring the examples into compliance with the new style mostly do not conflict with the Arduino IDE 1.x style. The only exception is the more complex code of the ArduinoISP sketch. In this case, the sketch is more of a utility program than an example, so the formatting changes will not be impactful for users who continue to use the outdated Arduino IDE version. --- .clang-format | 190 +++++++++++++ .github/workflows/code-formatting-check.yml | 37 +-- .../AnalogReadSerial/AnalogReadSerial.ino | 2 +- .../01.Basics/BareMinimum/BareMinimum.ino | 2 - examples/01.Basics/Blink/Blink.ino | 8 +- .../DigitalReadSerial/DigitalReadSerial.ino | 2 +- examples/01.Basics/Fade/Fade.ino | 6 +- .../BlinkWithoutDelay/BlinkWithoutDelay.ino | 8 +- examples/02.Digital/Button/Button.ino | 6 +- examples/02.Digital/Debounce/Debounce.ino | 10 +- .../DigitalInputPullup/DigitalInputPullup.ino | 1 - .../StateChangeDetection.ino | 11 +- examples/02.Digital/toneKeyboard/pitches.h | 106 ++++---- .../02.Digital/toneKeyboard/toneKeyboard.ino | 3 +- examples/02.Digital/toneMelody/pitches.h | 106 ++++---- .../02.Digital/toneMultiple/toneMultiple.ino | 1 - .../tonePitchFollower/tonePitchFollower.ino | 2 +- .../AnalogInOutSerial/AnalogInOutSerial.ino | 6 +- .../03.Analog/AnalogInput/AnalogInput.ino | 2 +- .../03.Analog/Calibration/Calibration.ino | 10 +- examples/03.Analog/Fading/Fading.ino | 6 +- examples/03.Analog/Smoothing/Smoothing.ino | 10 +- .../ASCIITable/ASCIITable.ino | 4 +- examples/04.Communication/Dimmer/Dimmer.ino | 2 +- examples/04.Communication/Midi/Midi.ino | 2 +- .../PhysicalPixel/PhysicalPixel.ino | 4 +- .../ReadASCIIString/ReadASCIIString.ino | 1 - .../SerialCallResponse/SerialCallResponse.ino | 12 +- .../SerialCallResponseASCII.ino | 12 +- .../SerialEvent/SerialEvent.ino | 2 +- .../SerialPassthrough/SerialPassthrough.ino | 8 +- .../VirtualColorMixer/VirtualColorMixer.ino | 6 +- examples/05.Control/Arrays/Arrays.ino | 7 +- .../ForLoopIteration/ForLoopIteration.ino | 2 +- .../IfStatementConditional.ino | 8 +- .../WhileStatementConditional.ino | 10 +- examples/05.Control/switchCase/switchCase.ino | 14 +- examples/06.Sensors/ADXL3xx/ADXL3xx.ino | 10 +- examples/06.Sensors/Knock/Knock.ino | 12 +- examples/06.Sensors/Memsic2125/Memsic2125.ino | 4 +- .../RowColumnScanning/RowColumnScanning.ino | 1 - examples/07.Display/barGraph/barGraph.ino | 6 +- .../CharacterAnalysis/CharacterAnalysis.ino | 2 +- .../StringAdditionOperator.ino | 27 +- .../StringAppendOperator.ino | 15 +- .../StringCaseChanges/StringCaseChanges.ino | 5 +- .../StringCharacters/StringCharacters.ino | 5 +- .../StringComparisonOperators.ino | 4 +- .../StringConstructors/StringConstructors.ino | 30 +-- .../StringIndexOf/StringIndexOf.ino | 7 +- .../08.Strings/StringLength/StringLength.ino | 6 +- .../StringLengthTrim/StringLengthTrim.ino | 5 +- .../StringReplace/StringReplace.ino | 5 +- .../StringStartsWithEndsWith.ino | 5 +- .../StringSubstring/StringSubstring.ino | 5 +- .../08.Strings/StringToInt/StringToInt.ino | 4 +- .../KeyboardLogout/KeyboardLogout.ino | 3 +- .../KeyboardMessage/KeyboardMessage.ino | 6 +- .../KeyboardReprogram/KeyboardReprogram.ino | 3 +- .../KeyboardAndMouseControl.ino | 3 +- .../ButtonMouseControl/ButtonMouseControl.ino | 8 +- .../JoystickMouseControl.ino | 26 +- .../p02_SpaceshipInterface.ino | 16 +- .../p03_LoveOMeter/p03_LoveOMeter.ino | 6 +- .../p04_ColorMixingLamp.ino | 22 +- .../p05_ServoMoodIndicator.ino | 12 +- .../p07_Keyboard/p07_Keyboard.ino | 2 +- .../p08_DigitalHourglass.ino | 10 +- .../p09_MotorizedPinwheel.ino | 4 +- .../p10_Zoetrope/p10_Zoetrope.ino | 26 +- .../p12_KnockLock/p12_KnockLock.ino | 10 +- .../p15_HackingButtons/p15_HackingButtons.ino | 4 +- .../11.ArduinoISP/ArduinoISP/ArduinoISP.ino | 254 +++++++++--------- examples_formatter.conf | 45 ---- examples_formatter.sh | 10 +- 75 files changed, 701 insertions(+), 556 deletions(-) create mode 100644 .clang-format delete mode 100644 examples_formatter.conf diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..e608f4e --- /dev/null +++ b/.clang-format @@ -0,0 +1,190 @@ +# Source: https://github.com/arduino/tooling-project-assets/tree/main/other/clang-format-configuration +--- +AccessModifierOffset: -2 +AlignAfterOpenBracket: Align +AlignArrayOfStructures: None +AlignConsecutiveAssignments: None +AlignConsecutiveBitFields: None +AlignConsecutiveDeclarations: None +AlignConsecutiveMacros: None +AlignEscapedNewlines: DontAlign +AlignOperands: Align +AlignTrailingComments: true +AllowAllArgumentsOnNextLine: true +AllowAllConstructorInitializersOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: Always +AllowShortCaseLabelsOnASingleLine: true +AllowShortEnumsOnASingleLine: true +AllowShortFunctionsOnASingleLine: Empty +AllowShortIfStatementsOnASingleLine: AllIfsAndElse +AllowShortLambdasOnASingleLine: Empty +AllowShortLoopsOnASingleLine: true +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: No +AttributeMacros: + - __capability +BasedOnStyle: LLVM +BinPackArguments: true +BinPackParameters: true +BitFieldColonSpacing: Both +BraceWrapping: + AfterCaseLabel: false + AfterClass: false + AfterControlStatement: Never + AfterEnum: false + AfterFunction: false + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: false + AfterUnion: false + AfterExternBlock: false + BeforeCatch: false + BeforeElse: false + BeforeLambdaBody: false + BeforeWhile: false + IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true +BreakAfterJavaFieldAnnotations: false +BreakBeforeBinaryOperators: NonAssignment +BreakBeforeBraces: Attach +BreakBeforeConceptDeclarations: false +BreakBeforeInheritanceComma: false +BreakBeforeTernaryOperators: true +BreakConstructorInitializers: BeforeColon +BreakConstructorInitializersBeforeComma: false +BreakInheritanceList: BeforeColon +BreakStringLiterals: false +ColumnLimit: 0 +CommentPragmas: '' +CompactNamespaces: false +ConstructorInitializerAllOnOneLineOrOnePerLine: false +ConstructorInitializerIndentWidth: 2 +ContinuationIndentWidth: 2 +Cpp11BracedListStyle: false +DeriveLineEnding: true +DerivePointerAlignment: true +DisableFormat: false +EmptyLineAfterAccessModifier: Leave +EmptyLineBeforeAccessModifier: Leave +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: false +ForEachMacros: + - foreach + - Q_FOREACH + - BOOST_FOREACH +IfMacros: + - KJ_IF_MAYBE +IncludeBlocks: Preserve +IncludeCategories: + - Regex: '^"(llvm|llvm-c|clang|clang-c)/' + Priority: 2 + SortPriority: 0 + CaseSensitive: false + - Regex: '^(<|"(gtest|gmock|isl|json)/)' + Priority: 3 + SortPriority: 0 + CaseSensitive: false + - Regex: '.*' + Priority: 1 + SortPriority: 0 + CaseSensitive: false +IncludeIsMainRegex: '' +IncludeIsMainSourceRegex: '' +IndentAccessModifiers: false +IndentCaseBlocks: true +IndentCaseLabels: true +IndentExternBlock: Indent +IndentGotoLabels: false +IndentPPDirectives: None +IndentRequires: true +IndentWidth: 2 +IndentWrappedFunctionNames: false +InsertTrailingCommas: None +JavaScriptQuotes: Leave +JavaScriptWrapImports: true +KeepEmptyLinesAtTheStartOfBlocks: true +LambdaBodyIndentation: Signature +Language: Cpp +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 100000 +NamespaceIndentation: None +ObjCBinPackProtocolList: Auto +ObjCBlockIndentWidth: 2 +ObjCBreakBeforeNestedBlockParam: true +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: true +PPIndentWidth: -1 +PackConstructorInitializers: BinPack +PenaltyBreakAssignment: 1 +PenaltyBreakBeforeFirstCallParameter: 1 +PenaltyBreakComment: 1 +PenaltyBreakFirstLessLess: 1 +PenaltyBreakOpenParenthesis: 1 +PenaltyBreakString: 1 +PenaltyBreakTemplateDeclaration: 1 +PenaltyExcessCharacter: 1 +PenaltyIndentedWhitespace: 1 +PenaltyReturnTypeOnItsOwnLine: 1 +PointerAlignment: Right +QualifierAlignment: Leave +ReferenceAlignment: Pointer +ReflowComments: false +RemoveBracesLLVM: false +SeparateDefinitionBlocks: Leave +ShortNamespaceLines: 0 +SortIncludes: Never +SortJavaStaticImport: Before +SortUsingDeclarations: false +SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: false +SpaceAroundPointerQualifiers: Default +SpaceBeforeAssignmentOperators: true +SpaceBeforeCaseColon: false +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeParens: ControlStatements +SpaceBeforeParensOptions: + AfterControlStatements: true + AfterForeachMacros: true + AfterFunctionDefinitionName: false + AfterFunctionDeclarationName: false + AfterIfMacros: true + AfterOverloadedOperator: false + BeforeNonEmptyParentheses: false +SpaceBeforeRangeBasedForLoopColon: true +SpaceBeforeSquareBrackets: false +SpaceInEmptyBlock: false +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 2 +SpacesInAngles: Leave +SpacesInCStyleCastParentheses: false +SpacesInConditionalStatement: false +SpacesInContainerLiterals: false +SpacesInLineCommentPrefix: + Minimum: 0 + Maximum: -1 +SpacesInParentheses: false +SpacesInSquareBrackets: false +Standard: Auto +StatementAttributeLikeMacros: + - Q_EMIT +StatementMacros: + - Q_UNUSED + - QT_REQUIRE_VERSION +TabWidth: 2 +UseCRLF: false +UseTab: Never +WhitespaceSensitiveMacros: + - STRINGIZE + - PP_STRINGIZE + - BOOST_PP_STRINGIZE + - NS_SWIFT_NAME + - CF_SWIFT_NAME diff --git a/.github/workflows/code-formatting-check.yml b/.github/workflows/code-formatting-check.yml index 98a09e2..5406dae 100644 --- a/.github/workflows/code-formatting-check.yml +++ b/.github/workflows/code-formatting-check.yml @@ -4,13 +4,13 @@ on: pull_request: paths: - ".github/workflows/code-formatting-check.yml" - - "examples_formatter.conf" + - ".clang-format" - "examples_formatter.sh" - "examples/**" push: paths: - ".github/workflows/code-formatting-check.yml" - - "examples_formatter.conf" + - ".clang-format" - "examples_formatter.sh" - "examples/**" @@ -19,31 +19,34 @@ jobs: runs-on: ubuntu-latest env: - # See: https://sourceforge.net/projects/astyle/files/astyle/ - ASTYLE_VERSION: 3.1 + # See: https://github.com/arduino/arduino-ide/blob/main/arduino-ide-extension/package.json + CLANG_FORMAT_VERSION: 14.0.0 steps: + - name: Set environment variables + run: | + # See: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable + echo "CLANG_FORMAT_INSTALL_PATH=${{ runner.temp }}/clang-format" >> "$GITHUB_ENV" + - name: Checkout uses: actions/checkout@v3 - # See: http://astyle.sourceforge.net/ - - name: Download Artistic Style - uses: carlosperate/download-file-action@v1 + - name: Download ClangFormat + id: download + uses: MrOctopus/download-asset-action@1.0 with: - file-url: https://cfhcable.dl.sourceforge.net/project/astyle/astyle/astyle%20${{ env.ASTYLE_VERSION }}/astyle_${{ env.ASTYLE_VERSION }}_linux.tar.gz - location: ${{ runner.temp }}/astyle + repository: arduino/clang-static-binaries + tag: ${{ env.CLANG_FORMAT_VERSION }} + asset: clang-format_${{ env.CLANG_FORMAT_VERSION }}_Linux_64bit.tar.bz2 + target: ${{ env.CLANG_FORMAT_INSTALL_PATH }} - # See: http://astyle.sourceforge.net/install.html#_GCC_Makefile - - name: Build Artistic Style + - name: Install ClangFormat run: | - # Build Artistic Style - cd "${{ runner.temp }}/astyle" - tar --extract --file="astyle_${{ env.ASTYLE_VERSION }}_linux.tar.gz" - cd "astyle/build/gcc" - make + cd "${{ env.CLANG_FORMAT_INSTALL_PATH }}" + tar --extract --file="${{ steps.download.outputs.name }}" # Add installation to PATH: # See: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path - echo "${{ runner.temp }}/astyle/astyle/build/gcc/bin" >> "$GITHUB_PATH" + echo "${{ env.CLANG_FORMAT_INSTALL_PATH }}/clang_Linux_64bit" >> "$GITHUB_PATH" - name: Format examples run: ./examples_formatter.sh diff --git a/examples/01.Basics/AnalogReadSerial/AnalogReadSerial.ino b/examples/01.Basics/AnalogReadSerial/AnalogReadSerial.ino index 10e67ec..d1dd321 100644 --- a/examples/01.Basics/AnalogReadSerial/AnalogReadSerial.ino +++ b/examples/01.Basics/AnalogReadSerial/AnalogReadSerial.ino @@ -22,5 +22,5 @@ void loop() { int sensorValue = analogRead(A0); // print out the value you read: Serial.println(sensorValue); - delay(1); // delay in between reads for stability + delay(1); // delay in between reads for stability } diff --git a/examples/01.Basics/BareMinimum/BareMinimum.ino b/examples/01.Basics/BareMinimum/BareMinimum.ino index 95c2b6e..ab62321 100644 --- a/examples/01.Basics/BareMinimum/BareMinimum.ino +++ b/examples/01.Basics/BareMinimum/BareMinimum.ino @@ -1,9 +1,7 @@ void setup() { // put your setup code here, to run once: - } void loop() { // put your main code here, to run repeatedly: - } diff --git a/examples/01.Basics/Blink/Blink.ino b/examples/01.Basics/Blink/Blink.ino index 9abb8f5..9f8b472 100644 --- a/examples/01.Basics/Blink/Blink.ino +++ b/examples/01.Basics/Blink/Blink.ino @@ -30,8 +30,8 @@ void setup() { // the loop function runs over and over again forever void loop() { - digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) - delay(1000); // wait for a second - digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW - delay(1000); // wait for a second + digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) + delay(1000); // wait for a second + digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW + delay(1000); // wait for a second } diff --git a/examples/01.Basics/DigitalReadSerial/DigitalReadSerial.ino b/examples/01.Basics/DigitalReadSerial/DigitalReadSerial.ino index 49389fe..3456f2f 100644 --- a/examples/01.Basics/DigitalReadSerial/DigitalReadSerial.ino +++ b/examples/01.Basics/DigitalReadSerial/DigitalReadSerial.ino @@ -25,5 +25,5 @@ void loop() { int buttonState = digitalRead(pushButton); // print out the state of the button: Serial.println(buttonState); - delay(1); // delay in between reads for stability + delay(1); // delay in between reads for stability } diff --git a/examples/01.Basics/Fade/Fade.ino b/examples/01.Basics/Fade/Fade.ino index e598b03..4637979 100644 --- a/examples/01.Basics/Fade/Fade.ino +++ b/examples/01.Basics/Fade/Fade.ino @@ -13,9 +13,9 @@ https://www.arduino.cc/en/Tutorial/BuiltInExamples/Fade */ -int led = 9; // the PWM pin the LED is attached to -int brightness = 0; // how bright the LED is -int fadeAmount = 5; // how many points to fade the LED by +int led = 9; // the PWM pin the LED is attached to +int brightness = 0; // how bright the LED is +int fadeAmount = 5; // how many points to fade the LED by // the setup routine runs once when you press reset: void setup() { diff --git a/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino b/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino index ac47087..d266349 100644 --- a/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino +++ b/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino @@ -29,17 +29,17 @@ */ // constants won't change. Used here to set a pin number: -const int ledPin = LED_BUILTIN;// the number of the LED pin +const int ledPin = LED_BUILTIN; // the number of the LED pin // Variables will change: -int ledState = LOW; // ledState used to set the LED +int ledState = LOW; // ledState used to set the LED // Generally, you should use "unsigned long" for variables that hold time // The value will quickly become too large for an int to store -unsigned long previousMillis = 0; // will store last time LED was updated +unsigned long previousMillis = 0; // will store last time LED was updated // constants won't change: -const long interval = 1000; // interval at which to blink (milliseconds) +const long interval = 1000; // interval at which to blink (milliseconds) void setup() { // set the digital pin as output: diff --git a/examples/02.Digital/Button/Button.ino b/examples/02.Digital/Button/Button.ino index 7732bc8..e041c31 100644 --- a/examples/02.Digital/Button/Button.ino +++ b/examples/02.Digital/Button/Button.ino @@ -23,11 +23,11 @@ */ // constants won't change. They're used here to set pin numbers: -const int buttonPin = 2; // the number of the pushbutton pin -const int ledPin = 13; // the number of the LED pin +const int buttonPin = 2; // the number of the pushbutton pin +const int ledPin = 13; // the number of the LED pin // variables will change: -int buttonState = 0; // variable for reading the pushbutton status +int buttonState = 0; // variable for reading the pushbutton status void setup() { // initialize the LED pin as an output: diff --git a/examples/02.Digital/Debounce/Debounce.ino b/examples/02.Digital/Debounce/Debounce.ino index 42cd1dc..6460d90 100644 --- a/examples/02.Digital/Debounce/Debounce.ino +++ b/examples/02.Digital/Debounce/Debounce.ino @@ -28,13 +28,13 @@ */ // constants won't change. They're used here to set pin numbers: -const int buttonPin = 2; // the number of the pushbutton pin -const int ledPin = 13; // the number of the LED pin +const int buttonPin = 2; // the number of the pushbutton pin +const int ledPin = 13; // the number of the LED pin // Variables will change: -int ledState = HIGH; // the current state of the output pin -int buttonState; // the current reading from the input pin -int lastButtonState = LOW; // the previous reading from the input pin +int ledState = HIGH; // the current state of the output pin +int buttonState; // the current reading from the input pin +int lastButtonState = LOW; // the previous reading from the input pin // the following variables are unsigned longs because the time, measured in // milliseconds, will quickly become a bigger number than can be stored in an int. diff --git a/examples/02.Digital/DigitalInputPullup/DigitalInputPullup.ino b/examples/02.Digital/DigitalInputPullup/DigitalInputPullup.ino index 16863a0..0f0eea1 100644 --- a/examples/02.Digital/DigitalInputPullup/DigitalInputPullup.ino +++ b/examples/02.Digital/DigitalInputPullup/DigitalInputPullup.ino @@ -26,7 +26,6 @@ void setup() { //configure pin 2 as an input and enable the internal pull-up resistor pinMode(2, INPUT_PULLUP); pinMode(13, OUTPUT); - } void loop() { diff --git a/examples/02.Digital/StateChangeDetection/StateChangeDetection.ino b/examples/02.Digital/StateChangeDetection/StateChangeDetection.ino index d3b2122..5205e17 100644 --- a/examples/02.Digital/StateChangeDetection/StateChangeDetection.ino +++ b/examples/02.Digital/StateChangeDetection/StateChangeDetection.ino @@ -25,13 +25,13 @@ */ // this constant won't change: -const int buttonPin = 2; // the pin that the pushbutton is attached to -const int ledPin = 13; // the pin that the LED is attached to +const int buttonPin = 2; // the pin that the pushbutton is attached to +const int ledPin = 13; // the pin that the LED is attached to // Variables will change: -int buttonPushCounter = 0; // counter for the number of button presses -int buttonState = 0; // current state of the button -int lastButtonState = 0; // previous state of the button +int buttonPushCounter = 0; // counter for the number of button presses +int buttonState = 0; // current state of the button +int lastButtonState = 0; // previous state of the button void setup() { // initialize the button pin as a input: @@ -75,5 +75,4 @@ void loop() { } else { digitalWrite(ledPin, LOW); } - } diff --git a/examples/02.Digital/toneKeyboard/pitches.h b/examples/02.Digital/toneKeyboard/pitches.h index 70b06bc..a0d69ac 100644 --- a/examples/02.Digital/toneKeyboard/pitches.h +++ b/examples/02.Digital/toneKeyboard/pitches.h @@ -2,94 +2,92 @@ Public Constants *************************************************/ -#define NOTE_B0 31 -#define NOTE_C1 33 +#define NOTE_B0 31 +#define NOTE_C1 33 #define NOTE_CS1 35 -#define NOTE_D1 37 +#define NOTE_D1 37 #define NOTE_DS1 39 -#define NOTE_E1 41 -#define NOTE_F1 44 +#define NOTE_E1 41 +#define NOTE_F1 44 #define NOTE_FS1 46 -#define NOTE_G1 49 +#define NOTE_G1 49 #define NOTE_GS1 52 -#define NOTE_A1 55 +#define NOTE_A1 55 #define NOTE_AS1 58 -#define NOTE_B1 62 -#define NOTE_C2 65 +#define NOTE_B1 62 +#define NOTE_C2 65 #define NOTE_CS2 69 -#define NOTE_D2 73 +#define NOTE_D2 73 #define NOTE_DS2 78 -#define NOTE_E2 82 -#define NOTE_F2 87 +#define NOTE_E2 82 +#define NOTE_F2 87 #define NOTE_FS2 93 -#define NOTE_G2 98 +#define NOTE_G2 98 #define NOTE_GS2 104 -#define NOTE_A2 110 +#define NOTE_A2 110 #define NOTE_AS2 117 -#define NOTE_B2 123 -#define NOTE_C3 131 +#define NOTE_B2 123 +#define NOTE_C3 131 #define NOTE_CS3 139 -#define NOTE_D3 147 +#define NOTE_D3 147 #define NOTE_DS3 156 -#define NOTE_E3 165 -#define NOTE_F3 175 +#define NOTE_E3 165 +#define NOTE_F3 175 #define NOTE_FS3 185 -#define NOTE_G3 196 +#define NOTE_G3 196 #define NOTE_GS3 208 -#define NOTE_A3 220 +#define NOTE_A3 220 #define NOTE_AS3 233 -#define NOTE_B3 247 -#define NOTE_C4 262 +#define NOTE_B3 247 +#define NOTE_C4 262 #define NOTE_CS4 277 -#define NOTE_D4 294 +#define NOTE_D4 294 #define NOTE_DS4 311 -#define NOTE_E4 330 -#define NOTE_F4 349 +#define NOTE_E4 330 +#define NOTE_F4 349 #define NOTE_FS4 370 -#define NOTE_G4 392 +#define NOTE_G4 392 #define NOTE_GS4 415 -#define NOTE_A4 440 +#define NOTE_A4 440 #define NOTE_AS4 466 -#define NOTE_B4 494 -#define NOTE_C5 523 +#define NOTE_B4 494 +#define NOTE_C5 523 #define NOTE_CS5 554 -#define NOTE_D5 587 +#define NOTE_D5 587 #define NOTE_DS5 622 -#define NOTE_E5 659 -#define NOTE_F5 698 +#define NOTE_E5 659 +#define NOTE_F5 698 #define NOTE_FS5 740 -#define NOTE_G5 784 +#define NOTE_G5 784 #define NOTE_GS5 831 -#define NOTE_A5 880 +#define NOTE_A5 880 #define NOTE_AS5 932 -#define NOTE_B5 988 -#define NOTE_C6 1047 +#define NOTE_B5 988 +#define NOTE_C6 1047 #define NOTE_CS6 1109 -#define NOTE_D6 1175 +#define NOTE_D6 1175 #define NOTE_DS6 1245 -#define NOTE_E6 1319 -#define NOTE_F6 1397 +#define NOTE_E6 1319 +#define NOTE_F6 1397 #define NOTE_FS6 1480 -#define NOTE_G6 1568 +#define NOTE_G6 1568 #define NOTE_GS6 1661 -#define NOTE_A6 1760 +#define NOTE_A6 1760 #define NOTE_AS6 1865 -#define NOTE_B6 1976 -#define NOTE_C7 2093 +#define NOTE_B6 1976 +#define NOTE_C7 2093 #define NOTE_CS7 2217 -#define NOTE_D7 2349 +#define NOTE_D7 2349 #define NOTE_DS7 2489 -#define NOTE_E7 2637 -#define NOTE_F7 2794 +#define NOTE_E7 2637 +#define NOTE_F7 2794 #define NOTE_FS7 2960 -#define NOTE_G7 3136 +#define NOTE_G7 3136 #define NOTE_GS7 3322 -#define NOTE_A7 3520 +#define NOTE_A7 3520 #define NOTE_AS7 3729 -#define NOTE_B7 3951 -#define NOTE_C8 4186 +#define NOTE_B7 3951 +#define NOTE_C8 4186 #define NOTE_CS8 4435 -#define NOTE_D8 4699 +#define NOTE_D8 4699 #define NOTE_DS8 4978 - - diff --git a/examples/02.Digital/toneKeyboard/toneKeyboard.ino b/examples/02.Digital/toneKeyboard/toneKeyboard.ino index 99e1cc5..c8e73c6 100644 --- a/examples/02.Digital/toneKeyboard/toneKeyboard.ino +++ b/examples/02.Digital/toneKeyboard/toneKeyboard.ino @@ -19,7 +19,7 @@ #include "pitches.h" -const int threshold = 10; // minimum reading of the sensors that generates a note +const int threshold = 10; // minimum reading of the sensors that generates a note // notes to play, corresponding to the 3 sensors: int notes[] = { @@ -27,7 +27,6 @@ int notes[] = { }; void setup() { - } void loop() { diff --git a/examples/02.Digital/toneMelody/pitches.h b/examples/02.Digital/toneMelody/pitches.h index 70b06bc..a0d69ac 100644 --- a/examples/02.Digital/toneMelody/pitches.h +++ b/examples/02.Digital/toneMelody/pitches.h @@ -2,94 +2,92 @@ Public Constants *************************************************/ -#define NOTE_B0 31 -#define NOTE_C1 33 +#define NOTE_B0 31 +#define NOTE_C1 33 #define NOTE_CS1 35 -#define NOTE_D1 37 +#define NOTE_D1 37 #define NOTE_DS1 39 -#define NOTE_E1 41 -#define NOTE_F1 44 +#define NOTE_E1 41 +#define NOTE_F1 44 #define NOTE_FS1 46 -#define NOTE_G1 49 +#define NOTE_G1 49 #define NOTE_GS1 52 -#define NOTE_A1 55 +#define NOTE_A1 55 #define NOTE_AS1 58 -#define NOTE_B1 62 -#define NOTE_C2 65 +#define NOTE_B1 62 +#define NOTE_C2 65 #define NOTE_CS2 69 -#define NOTE_D2 73 +#define NOTE_D2 73 #define NOTE_DS2 78 -#define NOTE_E2 82 -#define NOTE_F2 87 +#define NOTE_E2 82 +#define NOTE_F2 87 #define NOTE_FS2 93 -#define NOTE_G2 98 +#define NOTE_G2 98 #define NOTE_GS2 104 -#define NOTE_A2 110 +#define NOTE_A2 110 #define NOTE_AS2 117 -#define NOTE_B2 123 -#define NOTE_C3 131 +#define NOTE_B2 123 +#define NOTE_C3 131 #define NOTE_CS3 139 -#define NOTE_D3 147 +#define NOTE_D3 147 #define NOTE_DS3 156 -#define NOTE_E3 165 -#define NOTE_F3 175 +#define NOTE_E3 165 +#define NOTE_F3 175 #define NOTE_FS3 185 -#define NOTE_G3 196 +#define NOTE_G3 196 #define NOTE_GS3 208 -#define NOTE_A3 220 +#define NOTE_A3 220 #define NOTE_AS3 233 -#define NOTE_B3 247 -#define NOTE_C4 262 +#define NOTE_B3 247 +#define NOTE_C4 262 #define NOTE_CS4 277 -#define NOTE_D4 294 +#define NOTE_D4 294 #define NOTE_DS4 311 -#define NOTE_E4 330 -#define NOTE_F4 349 +#define NOTE_E4 330 +#define NOTE_F4 349 #define NOTE_FS4 370 -#define NOTE_G4 392 +#define NOTE_G4 392 #define NOTE_GS4 415 -#define NOTE_A4 440 +#define NOTE_A4 440 #define NOTE_AS4 466 -#define NOTE_B4 494 -#define NOTE_C5 523 +#define NOTE_B4 494 +#define NOTE_C5 523 #define NOTE_CS5 554 -#define NOTE_D5 587 +#define NOTE_D5 587 #define NOTE_DS5 622 -#define NOTE_E5 659 -#define NOTE_F5 698 +#define NOTE_E5 659 +#define NOTE_F5 698 #define NOTE_FS5 740 -#define NOTE_G5 784 +#define NOTE_G5 784 #define NOTE_GS5 831 -#define NOTE_A5 880 +#define NOTE_A5 880 #define NOTE_AS5 932 -#define NOTE_B5 988 -#define NOTE_C6 1047 +#define NOTE_B5 988 +#define NOTE_C6 1047 #define NOTE_CS6 1109 -#define NOTE_D6 1175 +#define NOTE_D6 1175 #define NOTE_DS6 1245 -#define NOTE_E6 1319 -#define NOTE_F6 1397 +#define NOTE_E6 1319 +#define NOTE_F6 1397 #define NOTE_FS6 1480 -#define NOTE_G6 1568 +#define NOTE_G6 1568 #define NOTE_GS6 1661 -#define NOTE_A6 1760 +#define NOTE_A6 1760 #define NOTE_AS6 1865 -#define NOTE_B6 1976 -#define NOTE_C7 2093 +#define NOTE_B6 1976 +#define NOTE_C7 2093 #define NOTE_CS7 2217 -#define NOTE_D7 2349 +#define NOTE_D7 2349 #define NOTE_DS7 2489 -#define NOTE_E7 2637 -#define NOTE_F7 2794 +#define NOTE_E7 2637 +#define NOTE_F7 2794 #define NOTE_FS7 2960 -#define NOTE_G7 3136 +#define NOTE_G7 3136 #define NOTE_GS7 3322 -#define NOTE_A7 3520 +#define NOTE_A7 3520 #define NOTE_AS7 3729 -#define NOTE_B7 3951 -#define NOTE_C8 4186 +#define NOTE_B7 3951 +#define NOTE_C8 4186 #define NOTE_CS8 4435 -#define NOTE_D8 4699 +#define NOTE_D8 4699 #define NOTE_DS8 4978 - - diff --git a/examples/02.Digital/toneMultiple/toneMultiple.ino b/examples/02.Digital/toneMultiple/toneMultiple.ino index 63a6020..8d97fa7 100644 --- a/examples/02.Digital/toneMultiple/toneMultiple.ino +++ b/examples/02.Digital/toneMultiple/toneMultiple.ino @@ -16,7 +16,6 @@ */ void setup() { - } void loop() { diff --git a/examples/02.Digital/tonePitchFollower/tonePitchFollower.ino b/examples/02.Digital/tonePitchFollower/tonePitchFollower.ino index 3171cfc..592f671 100644 --- a/examples/02.Digital/tonePitchFollower/tonePitchFollower.ino +++ b/examples/02.Digital/tonePitchFollower/tonePitchFollower.ino @@ -35,5 +35,5 @@ void loop() { // play the pitch: tone(9, thisPitch, 10); - delay(1); // delay in between reads for stability + delay(1); // delay in between reads for stability } diff --git a/examples/03.Analog/AnalogInOutSerial/AnalogInOutSerial.ino b/examples/03.Analog/AnalogInOutSerial/AnalogInOutSerial.ino index 4033ca0..851342d 100644 --- a/examples/03.Analog/AnalogInOutSerial/AnalogInOutSerial.ino +++ b/examples/03.Analog/AnalogInOutSerial/AnalogInOutSerial.ino @@ -22,10 +22,10 @@ // These constants won't change. They're used to give names to the pins used: const int analogInPin = A0; // Analog input pin that the potentiometer is attached to -const int analogOutPin = 9; // Analog output pin that the LED is attached to +const int analogOutPin = 9; // Analog output pin that the LED is attached to -int sensorValue = 0; // value read from the pot -int outputValue = 0; // value output to the PWM (analog out) +int sensorValue = 0; // value read from the pot +int outputValue = 0; // value output to the PWM (analog out) void setup() { // initialize serial communications at 9600 bps: diff --git a/examples/03.Analog/AnalogInput/AnalogInput.ino b/examples/03.Analog/AnalogInput/AnalogInput.ino index 9a1bbdd..735a8b5 100644 --- a/examples/03.Analog/AnalogInput/AnalogInput.ino +++ b/examples/03.Analog/AnalogInput/AnalogInput.ino @@ -27,7 +27,7 @@ https://www.arduino.cc/en/Tutorial/BuiltInExamples/AnalogInput */ -int sensorPin = A0; // select the input pin for the potentiometer +int sensorPin = A0; // select the input pin for the potentiometer int ledPin = 13; // select the pin for the LED int sensorValue = 0; // variable to store the value coming from the sensor diff --git a/examples/03.Analog/Calibration/Calibration.ino b/examples/03.Analog/Calibration/Calibration.ino index ba5cf70..e0f639b 100644 --- a/examples/03.Analog/Calibration/Calibration.ino +++ b/examples/03.Analog/Calibration/Calibration.ino @@ -27,13 +27,13 @@ */ // These constants won't change: -const int sensorPin = A0; // pin that the sensor is attached to -const int ledPin = 9; // pin that the LED is attached to +const int sensorPin = A0; // pin that the sensor is attached to +const int ledPin = 9; // pin that the LED is attached to // variables: -int sensorValue = 0; // the sensor value -int sensorMin = 1023; // minimum sensor value -int sensorMax = 0; // maximum sensor value +int sensorValue = 0; // the sensor value +int sensorMin = 1023; // minimum sensor value +int sensorMax = 0; // maximum sensor value void setup() { diff --git a/examples/03.Analog/Fading/Fading.ino b/examples/03.Analog/Fading/Fading.ino index da694e5..7923546 100644 --- a/examples/03.Analog/Fading/Fading.ino +++ b/examples/03.Analog/Fading/Fading.ino @@ -16,7 +16,7 @@ https://www.arduino.cc/en/Tutorial/BuiltInExamples/Fading */ -int ledPin = 9; // LED connected to digital pin 9 +int ledPin = 9; // LED connected to digital pin 9 void setup() { // nothing happens in setup @@ -24,7 +24,7 @@ void setup() { void loop() { // fade in from min to max in increments of 5 points: - for (int fadeValue = 0 ; fadeValue <= 255; fadeValue += 5) { + for (int fadeValue = 0; fadeValue <= 255; fadeValue += 5) { // sets the value (range from 0 to 255): analogWrite(ledPin, fadeValue); // wait for 30 milliseconds to see the dimming effect @@ -32,7 +32,7 @@ void loop() { } // fade out from max to min in increments of 5 points: - for (int fadeValue = 255 ; fadeValue >= 0; fadeValue -= 5) { + for (int fadeValue = 255; fadeValue >= 0; fadeValue -= 5) { // sets the value (range from 0 to 255): analogWrite(ledPin, fadeValue); // wait for 30 milliseconds to see the dimming effect diff --git a/examples/03.Analog/Smoothing/Smoothing.ino b/examples/03.Analog/Smoothing/Smoothing.ino index eece339..15c0f1a 100644 --- a/examples/03.Analog/Smoothing/Smoothing.ino +++ b/examples/03.Analog/Smoothing/Smoothing.ino @@ -24,10 +24,10 @@ // value to determine the size of the readings array. const int numReadings = 10; -int readings[numReadings]; // the readings from the analog input -int readIndex = 0; // the index of the current reading -int total = 0; // the running total -int average = 0; // the average +int readings[numReadings]; // the readings from the analog input +int readIndex = 0; // the index of the current reading +int total = 0; // the running total +int average = 0; // the average int inputPin = A0; @@ -60,5 +60,5 @@ void loop() { average = total / numReadings; // send it to the computer as ASCII digits Serial.println(average); - delay(1); // delay in between reads for stability + delay(1); // delay in between reads for stability } diff --git a/examples/04.Communication/ASCIITable/ASCIITable.ino b/examples/04.Communication/ASCIITable/ASCIITable.ino index f3d4bd0..f7fc4d4 100644 --- a/examples/04.Communication/ASCIITable/ASCIITable.ino +++ b/examples/04.Communication/ASCIITable/ASCIITable.ino @@ -23,7 +23,7 @@ void setup() { //Initialize serial and wait for port to open: Serial.begin(9600); while (!Serial) { - ; // wait for serial port to connect. Needed for native USB port only + ; // wait for serial port to connect. Needed for native USB port only } // prints title with ending line break @@ -66,7 +66,7 @@ void loop() { Serial.println(thisByte, BIN); // if printed last visible character '~' or 126, stop: - if (thisByte == 126) { // you could also use if (thisByte == '~') { + if (thisByte == 126) { // you could also use if (thisByte == '~') { // This loop loops forever and does nothing while (true) { continue; diff --git a/examples/04.Communication/Dimmer/Dimmer.ino b/examples/04.Communication/Dimmer/Dimmer.ino index fc121a0..2f82344 100644 --- a/examples/04.Communication/Dimmer/Dimmer.ino +++ b/examples/04.Communication/Dimmer/Dimmer.ino @@ -20,7 +20,7 @@ https://www.arduino.cc/en/Tutorial/BuiltInExamples/Dimmer */ -const int ledPin = 9; // the pin that the LED is attached to +const int ledPin = 9; // the pin that the LED is attached to void setup() { // initialize the serial communication: diff --git a/examples/04.Communication/Midi/Midi.ino b/examples/04.Communication/Midi/Midi.ino index 851fa9b..0602bf0 100644 --- a/examples/04.Communication/Midi/Midi.ino +++ b/examples/04.Communication/Midi/Midi.ino @@ -27,7 +27,7 @@ void setup() { void loop() { // play notes from F#-0 (0x1E) to F#-5 (0x5A): - for (int note = 0x1E; note < 0x5A; note ++) { + for (int note = 0x1E; note < 0x5A; note++) { //Note on channel 1 (0x90), some note value (note), middle velocity (0x45): noteOn(0x90, note, 0x45); delay(100); diff --git a/examples/04.Communication/PhysicalPixel/PhysicalPixel.ino b/examples/04.Communication/PhysicalPixel/PhysicalPixel.ino index 1582118..cff02ef 100644 --- a/examples/04.Communication/PhysicalPixel/PhysicalPixel.ino +++ b/examples/04.Communication/PhysicalPixel/PhysicalPixel.ino @@ -21,8 +21,8 @@ https://www.arduino.cc/en/Tutorial/BuiltInExamples/PhysicalPixel */ -const int ledPin = 13; // the pin that the LED is attached to -int incomingByte; // a variable to read incoming serial data into +const int ledPin = 13; // the pin that the LED is attached to +int incomingByte; // a variable to read incoming serial data into void setup() { // initialize serial communication: diff --git a/examples/04.Communication/ReadASCIIString/ReadASCIIString.ino b/examples/04.Communication/ReadASCIIString/ReadASCIIString.ino index bbd395b..1cab997 100644 --- a/examples/04.Communication/ReadASCIIString/ReadASCIIString.ino +++ b/examples/04.Communication/ReadASCIIString/ReadASCIIString.ino @@ -33,7 +33,6 @@ void setup() { pinMode(redPin, OUTPUT); pinMode(greenPin, OUTPUT); pinMode(bluePin, OUTPUT); - } void loop() { diff --git a/examples/04.Communication/SerialCallResponse/SerialCallResponse.ino b/examples/04.Communication/SerialCallResponse/SerialCallResponse.ino index 6fb0a60..b778774 100644 --- a/examples/04.Communication/SerialCallResponse/SerialCallResponse.ino +++ b/examples/04.Communication/SerialCallResponse/SerialCallResponse.ino @@ -21,16 +21,16 @@ https://www.arduino.cc/en/Tutorial/BuiltInExamples/SerialCallResponse */ -int firstSensor = 0; // first analog sensor -int secondSensor = 0; // second analog sensor -int thirdSensor = 0; // digital sensor -int inByte = 0; // incoming serial byte +int firstSensor = 0; // first analog sensor +int secondSensor = 0; // second analog sensor +int thirdSensor = 0; // digital sensor +int inByte = 0; // incoming serial byte void setup() { // start serial port at 9600 bps: Serial.begin(9600); while (!Serial) { - ; // wait for serial port to connect. Needed for native USB port only + ; // wait for serial port to connect. Needed for native USB port only } pinMode(2, INPUT); // digital sensor is on digital pin 2 @@ -59,7 +59,7 @@ void loop() { void establishContact() { while (Serial.available() <= 0) { - Serial.print('A'); // send a capital A + Serial.print('A'); // send a capital A delay(300); } } diff --git a/examples/04.Communication/SerialCallResponseASCII/SerialCallResponseASCII.ino b/examples/04.Communication/SerialCallResponseASCII/SerialCallResponseASCII.ino index 44b2155..e5b02cd 100644 --- a/examples/04.Communication/SerialCallResponseASCII/SerialCallResponseASCII.ino +++ b/examples/04.Communication/SerialCallResponseASCII/SerialCallResponseASCII.ino @@ -22,16 +22,16 @@ https://www.arduino.cc/en/Tutorial/BuiltInExamples/SerialCallResponseASCII */ -int firstSensor = 0; // first analog sensor -int secondSensor = 0; // second analog sensor -int thirdSensor = 0; // digital sensor -int inByte = 0; // incoming serial byte +int firstSensor = 0; // first analog sensor +int secondSensor = 0; // second analog sensor +int thirdSensor = 0; // digital sensor +int inByte = 0; // incoming serial byte void setup() { // start serial port at 9600 bps and wait for port to open: Serial.begin(9600); while (!Serial) { - ; // wait for serial port to connect. Needed for native USB port only + ; // wait for serial port to connect. Needed for native USB port only } @@ -61,7 +61,7 @@ void loop() { void establishContact() { while (Serial.available() <= 0) { - Serial.println("0,0,0"); // send an initial string + Serial.println("0,0,0"); // send an initial string delay(300); } } diff --git a/examples/04.Communication/SerialEvent/SerialEvent.ino b/examples/04.Communication/SerialEvent/SerialEvent.ino index 831b98d..13c5630 100644 --- a/examples/04.Communication/SerialEvent/SerialEvent.ino +++ b/examples/04.Communication/SerialEvent/SerialEvent.ino @@ -18,7 +18,7 @@ https://www.arduino.cc/en/Tutorial/BuiltInExamples/SerialEvent */ -String inputString = ""; // a String to hold incoming data +String inputString = ""; // a String to hold incoming data bool stringComplete = false; // whether the string is complete void setup() { diff --git a/examples/04.Communication/SerialPassthrough/SerialPassthrough.ino b/examples/04.Communication/SerialPassthrough/SerialPassthrough.ino index 84824cf..8f46bbe 100644 --- a/examples/04.Communication/SerialPassthrough/SerialPassthrough.ino +++ b/examples/04.Communication/SerialPassthrough/SerialPassthrough.ino @@ -30,11 +30,11 @@ void setup() { } void loop() { - if (Serial.available()) { // If anything comes in Serial (USB), - Serial1.write(Serial.read()); // read it and send it out Serial1 (pins 0 & 1) + if (Serial.available()) { // If anything comes in Serial (USB), + Serial1.write(Serial.read()); // read it and send it out Serial1 (pins 0 & 1) } - if (Serial1.available()) { // If anything comes in Serial1 (pins 0 & 1) - Serial.write(Serial1.read()); // read it and send it out Serial (USB) + if (Serial1.available()) { // If anything comes in Serial1 (pins 0 & 1) + Serial.write(Serial1.read()); // read it and send it out Serial (USB) } } diff --git a/examples/04.Communication/VirtualColorMixer/VirtualColorMixer.ino b/examples/04.Communication/VirtualColorMixer/VirtualColorMixer.ino index cf66348..6ffd934 100644 --- a/examples/04.Communication/VirtualColorMixer/VirtualColorMixer.ino +++ b/examples/04.Communication/VirtualColorMixer/VirtualColorMixer.ino @@ -16,9 +16,9 @@ https://www.arduino.cc/en/Tutorial/BuiltInExamples/VirtualColorMixer */ -const int redPin = A0; // sensor to control red color -const int greenPin = A1; // sensor to control green color -const int bluePin = A2; // sensor to control blue color +const int redPin = A0; // sensor to control red color +const int greenPin = A1; // sensor to control green color +const int bluePin = A2; // sensor to control blue color void setup() { Serial.begin(9600); diff --git a/examples/05.Control/Arrays/Arrays.ino b/examples/05.Control/Arrays/Arrays.ino index dbbb4b4..75d59ee 100644 --- a/examples/05.Control/Arrays/Arrays.ino +++ b/examples/05.Control/Arrays/Arrays.ino @@ -20,11 +20,11 @@ https://www.arduino.cc/en/Tutorial/BuiltInExamples/Arrays */ -int timer = 100; // The higher the number, the slower the timing. +int timer = 100; // The higher the number, the slower the timing. int ledPins[] = { 2, 7, 4, 6, 5, 3 -}; // an array of pin numbers to which LEDs are attached -int pinCount = 6; // the number of pins (i.e. the length of the array) +}; // an array of pin numbers to which LEDs are attached +int pinCount = 6; // the number of pins (i.e. the length of the array) void setup() { // the array elements are numbered from 0 to (pinCount - 1). @@ -42,7 +42,6 @@ void loop() { delay(timer); // turn the pin off: digitalWrite(ledPins[thisPin], LOW); - } // loop from the highest pin to the lowest: diff --git a/examples/05.Control/ForLoopIteration/ForLoopIteration.ino b/examples/05.Control/ForLoopIteration/ForLoopIteration.ino index af9cd7d..e6b40e7 100644 --- a/examples/05.Control/ForLoopIteration/ForLoopIteration.ino +++ b/examples/05.Control/ForLoopIteration/ForLoopIteration.ino @@ -17,7 +17,7 @@ https://www.arduino.cc/en/Tutorial/BuiltInExamples/ForLoopIteration */ -int timer = 100; // The higher the number, the slower the timing. +int timer = 100; // The higher the number, the slower the timing. void setup() { // use a for loop to initialize each pin as an output: diff --git a/examples/05.Control/IfStatementConditional/IfStatementConditional.ino b/examples/05.Control/IfStatementConditional/IfStatementConditional.ino index efd233f..ac6041a 100644 --- a/examples/05.Control/IfStatementConditional/IfStatementConditional.ino +++ b/examples/05.Control/IfStatementConditional/IfStatementConditional.ino @@ -25,9 +25,9 @@ */ // These constants won't change: -const int analogPin = A0; // pin that the sensor is attached to -const int ledPin = 13; // pin that the LED is attached to -const int threshold = 400; // an arbitrary threshold level that's in the range of the analog input +const int analogPin = A0; // pin that the sensor is attached to +const int ledPin = 13; // pin that the LED is attached to +const int threshold = 400; // an arbitrary threshold level that's in the range of the analog input void setup() { // initialize the LED pin as an output: @@ -49,5 +49,5 @@ void loop() { // print the analog value: Serial.println(analogValue); - delay(1); // delay in between reads for stability + delay(1); // delay in between reads for stability } diff --git a/examples/05.Control/WhileStatementConditional/WhileStatementConditional.ino b/examples/05.Control/WhileStatementConditional/WhileStatementConditional.ino index a0b42e1..0a36341 100644 --- a/examples/05.Control/WhileStatementConditional/WhileStatementConditional.ino +++ b/examples/05.Control/WhileStatementConditional/WhileStatementConditional.ino @@ -29,16 +29,16 @@ // These constants won't change: -const int sensorPin = A0; // pin that the sensor is attached to -const int ledPin = 9; // pin that the LED is attached to -const int indicatorLedPin = 13; // pin that the built-in LED is attached to -const int buttonPin = 2; // pin that the button is attached to +const int sensorPin = A0; // pin that the sensor is attached to +const int ledPin = 9; // pin that the LED is attached to +const int indicatorLedPin = 13; // pin that the built-in LED is attached to +const int buttonPin = 2; // pin that the button is attached to // These variables will change: int sensorMin = 1023; // minimum sensor value int sensorMax = 0; // maximum sensor value -int sensorValue = 0; // the sensor value +int sensorValue = 0; // the sensor value void setup() { diff --git a/examples/05.Control/switchCase/switchCase.ino b/examples/05.Control/switchCase/switchCase.ino index 3ffc9f0..f964b61 100644 --- a/examples/05.Control/switchCase/switchCase.ino +++ b/examples/05.Control/switchCase/switchCase.ino @@ -23,8 +23,8 @@ // these constants won't change. They are the lowest and highest readings you // get from your sensor: -const int sensorMin = 0; // sensor minimum, discovered through experiment -const int sensorMax = 600; // sensor maximum, discovered through experiment +const int sensorMin = 0; // sensor minimum, discovered through experiment +const int sensorMax = 600; // sensor maximum, discovered through experiment void setup() { // initialize serial communication: @@ -39,18 +39,18 @@ void loop() { // do something different depending on the range value: switch (range) { - case 0: // your hand is on the sensor + case 0: // your hand is on the sensor Serial.println("dark"); break; - case 1: // your hand is close to the sensor + case 1: // your hand is close to the sensor Serial.println("dim"); break; - case 2: // your hand is a few inches from the sensor + case 2: // your hand is a few inches from the sensor Serial.println("medium"); break; - case 3: // your hand is nowhere near the sensor + case 3: // your hand is nowhere near the sensor Serial.println("bright"); break; } - delay(1); // delay in between reads for stability + delay(1); // delay in between reads for stability } diff --git a/examples/06.Sensors/ADXL3xx/ADXL3xx.ino b/examples/06.Sensors/ADXL3xx/ADXL3xx.ino index 65b579b..b9dbf64 100644 --- a/examples/06.Sensors/ADXL3xx/ADXL3xx.ino +++ b/examples/06.Sensors/ADXL3xx/ADXL3xx.ino @@ -25,11 +25,11 @@ */ // these constants describe the pins. They won't change: -const int groundpin = 18; // analog input pin 4 -- ground -const int powerpin = 19; // analog input pin 5 -- voltage -const int xpin = A3; // x-axis of the accelerometer -const int ypin = A2; // y-axis -const int zpin = A1; // z-axis (only on 3-axis models) +const int groundpin = 18; // analog input pin 4 -- ground +const int powerpin = 19; // analog input pin 5 -- voltage +const int xpin = A3; // x-axis of the accelerometer +const int ypin = A2; // y-axis +const int zpin = A1; // z-axis (only on 3-axis models) void setup() { // initialize the serial communications: diff --git a/examples/06.Sensors/Knock/Knock.ino b/examples/06.Sensors/Knock/Knock.ino index 815d721..0e21486 100644 --- a/examples/06.Sensors/Knock/Knock.ino +++ b/examples/06.Sensors/Knock/Knock.ino @@ -23,17 +23,17 @@ // these constants won't change: -const int ledPin = 13; // LED connected to digital pin 13 -const int knockSensor = A0; // the piezo is connected to analog pin 0 -const int threshold = 100; // threshold value to decide when the detected sound is a knock or not +const int ledPin = 13; // LED connected to digital pin 13 +const int knockSensor = A0; // the piezo is connected to analog pin 0 +const int threshold = 100; // threshold value to decide when the detected sound is a knock or not // these variables will change: -int sensorReading = 0; // variable to store the value read from the sensor pin -int ledState = LOW; // variable used to store the last LED status, to toggle the light +int sensorReading = 0; // variable to store the value read from the sensor pin +int ledState = LOW; // variable used to store the last LED status, to toggle the light void setup() { - pinMode(ledPin, OUTPUT); // declare the ledPin as as OUTPUT + pinMode(ledPin, OUTPUT); // declare the ledPin as as OUTPUT Serial.begin(9600); // use the serial port } diff --git a/examples/06.Sensors/Memsic2125/Memsic2125.ino b/examples/06.Sensors/Memsic2125/Memsic2125.ino index b95472b..006306b 100644 --- a/examples/06.Sensors/Memsic2125/Memsic2125.ino +++ b/examples/06.Sensors/Memsic2125/Memsic2125.ino @@ -22,8 +22,8 @@ */ // these constants won't change: -const int xPin = 2; // X output of the accelerometer -const int yPin = 3; // Y output of the accelerometer +const int xPin = 2; // X output of the accelerometer +const int yPin = 3; // Y output of the accelerometer void setup() { // initialize serial communications: diff --git a/examples/07.Display/RowColumnScanning/RowColumnScanning.ino b/examples/07.Display/RowColumnScanning/RowColumnScanning.ino index 023a5c2..0fb04c5 100644 --- a/examples/07.Display/RowColumnScanning/RowColumnScanning.ino +++ b/examples/07.Display/RowColumnScanning/RowColumnScanning.ino @@ -83,7 +83,6 @@ void readSensors() { // set the new pixel position low so that the LED will turn on in the next // screen refresh: pixels[x][y] = LOW; - } void refreshScreen() { diff --git a/examples/07.Display/barGraph/barGraph.ino b/examples/07.Display/barGraph/barGraph.ino index ab97f13..b15f840 100644 --- a/examples/07.Display/barGraph/barGraph.ino +++ b/examples/07.Display/barGraph/barGraph.ino @@ -21,12 +21,12 @@ */ // these constants won't change: -const int analogPin = A0; // the pin that the potentiometer is attached to -const int ledCount = 10; // the number of LEDs in the bar graph +const int analogPin = A0; // the pin that the potentiometer is attached to +const int ledCount = 10; // the number of LEDs in the bar graph int ledPins[] = { 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 -}; // an array of pin numbers to which LEDs are attached +}; // an array of pin numbers to which LEDs are attached void setup() { diff --git a/examples/08.Strings/CharacterAnalysis/CharacterAnalysis.ino b/examples/08.Strings/CharacterAnalysis/CharacterAnalysis.ino index e7a3c23..40d68a5 100644 --- a/examples/08.Strings/CharacterAnalysis/CharacterAnalysis.ino +++ b/examples/08.Strings/CharacterAnalysis/CharacterAnalysis.ino @@ -17,7 +17,7 @@ void setup() { // Open serial communications and wait for port to open: Serial.begin(9600); while (!Serial) { - ; // wait for serial port to connect. Needed for native USB port only + ; // wait for serial port to connect. Needed for native USB port only } // send an intro: diff --git a/examples/08.Strings/StringAdditionOperator/StringAdditionOperator.ino b/examples/08.Strings/StringAdditionOperator/StringAdditionOperator.ino index 531742b..4763acf 100644 --- a/examples/08.Strings/StringAdditionOperator/StringAdditionOperator.ino +++ b/examples/08.Strings/StringAdditionOperator/StringAdditionOperator.ino @@ -20,7 +20,7 @@ void setup() { // initialize serial and wait for port to open: Serial.begin(9600); while (!Serial) { - ; // wait for serial port to connect. Needed for native USB port only + ; // wait for serial port to connect. Needed for native USB port only } stringOne = String("You added "); @@ -33,35 +33,36 @@ void setup() { void loop() { // adding a constant integer to a String: - stringThree = stringOne + 123; - Serial.println(stringThree); // prints "You added 123" + stringThree = stringOne + 123; + Serial.println(stringThree); // prints "You added 123" // adding a constant long integer to a String: stringThree = stringOne + 123456789; - Serial.println(stringThree); // prints "You added 123456789" + Serial.println(stringThree); // prints "You added 123456789" // adding a constant character to a String: - stringThree = stringOne + 'A'; - Serial.println(stringThree); // prints "You added A" + stringThree = stringOne + 'A'; + Serial.println(stringThree); // prints "You added A" // adding a constant string to a String: - stringThree = stringOne + "abc"; - Serial.println(stringThree); // prints "You added abc" + stringThree = stringOne + "abc"; + Serial.println(stringThree); // prints "You added abc" stringThree = stringOne + stringTwo; - Serial.println(stringThree); // prints "You added this string" + Serial.println(stringThree); // prints "You added this string" // adding a variable integer to a String: int sensorValue = analogRead(A0); stringOne = "Sensor value: "; - stringThree = stringOne + sensorValue; - Serial.println(stringThree); // prints "Sensor Value: 401" or whatever value analogRead(A0) has + stringThree = stringOne + sensorValue; + Serial.println(stringThree); // prints "Sensor Value: 401" or whatever value analogRead(A0) has // adding a variable long integer to a String: stringOne = "millis() value: "; stringThree = stringOne + millis(); - Serial.println(stringThree); // prints "The millis: 345345" or whatever value millis() has + Serial.println(stringThree); // prints "The millis: 345345" or whatever value millis() has // do nothing while true: - while (true); + while (true) + ; } diff --git a/examples/08.Strings/StringAppendOperator/StringAppendOperator.ino b/examples/08.Strings/StringAppendOperator/StringAppendOperator.ino index b634892..4846cf4 100644 --- a/examples/08.Strings/StringAppendOperator/StringAppendOperator.ino +++ b/examples/08.Strings/StringAppendOperator/StringAppendOperator.ino @@ -18,7 +18,7 @@ void setup() { // Open serial communications and wait for port to open: Serial.begin(9600); while (!Serial) { - ; // wait for serial port to connect. Needed for native USB port only + ; // wait for serial port to connect. Needed for native USB port only } stringOne = String("Sensor "); @@ -41,11 +41,11 @@ void loop() { // adding a constant character to a String: stringOne += 'A'; - Serial.println(stringOne); // prints "Sensor value for input A" + Serial.println(stringOne); // prints "Sensor value for input A" // adding a constant integer to a String: stringOne += 0; - Serial.println(stringOne); // prints "Sensor value for input A0" + Serial.println(stringOne); // prints "Sensor value for input A0" // adding a constant string to a String: stringOne += ": "; @@ -53,7 +53,7 @@ void loop() { // adding a variable integer to a String: stringOne += analogRead(A0); - Serial.println(stringOne); // prints "Sensor value for input A0: 456" or whatever analogRead(A0) is + Serial.println(stringOne); // prints "Sensor value for input A0: 456" or whatever analogRead(A0) is Serial.println("\n\nchanging the Strings' values"); stringOne = "A long integer: "; @@ -61,12 +61,13 @@ void loop() { // adding a constant long integer to a String: stringOne += 123456789; - Serial.println(stringOne); // prints "A long integer: 123456789" + Serial.println(stringOne); // prints "A long integer: 123456789" // using concat() to add a long variable to a String: stringTwo.concat(millis()); - Serial.println(stringTwo); // prints "The millis(): 43534" or whatever the value of the millis() is + Serial.println(stringTwo); // prints "The millis(): 43534" or whatever the value of the millis() is // do nothing while true: - while (true); + while (true) + ; } diff --git a/examples/08.Strings/StringCaseChanges/StringCaseChanges.ino b/examples/08.Strings/StringCaseChanges/StringCaseChanges.ino index fc6ab61..52d4de8 100644 --- a/examples/08.Strings/StringCaseChanges/StringCaseChanges.ino +++ b/examples/08.Strings/StringCaseChanges/StringCaseChanges.ino @@ -16,7 +16,7 @@ void setup() { // Open serial communications and wait for port to open: Serial.begin(9600); while (!Serial) { - ; // wait for serial port to connect. Needed for native USB port only + ; // wait for serial port to connect. Needed for native USB port only } // send an intro: @@ -39,5 +39,6 @@ void loop() { // do nothing while true: - while (true); + while (true) + ; } diff --git a/examples/08.Strings/StringCharacters/StringCharacters.ino b/examples/08.Strings/StringCharacters/StringCharacters.ino index a179cfa..6c64b57 100644 --- a/examples/08.Strings/StringCharacters/StringCharacters.ino +++ b/examples/08.Strings/StringCharacters/StringCharacters.ino @@ -16,7 +16,7 @@ void setup() { // Open serial communications and wait for port to open: Serial.begin(9600); while (!Serial) { - ; // wait for serial port to connect. Needed for native USB port only + ; // wait for serial port to connect. Needed for native USB port only } Serial.println("\n\nString charAt() and setCharAt():"); @@ -41,5 +41,6 @@ void loop() { Serial.println(reportString); // do nothing while true: - while (true); + while (true) + ; } diff --git a/examples/08.Strings/StringComparisonOperators/StringComparisonOperators.ino b/examples/08.Strings/StringComparisonOperators/StringComparisonOperators.ino index aff9139..4e57469 100644 --- a/examples/08.Strings/StringComparisonOperators/StringComparisonOperators.ino +++ b/examples/08.Strings/StringComparisonOperators/StringComparisonOperators.ino @@ -18,7 +18,7 @@ void setup() { // Open serial communications and wait for port to open: Serial.begin(9600); while (!Serial) { - ; // wait for serial port to connect. Needed for native USB port only + ; // wait for serial port to connect. Needed for native USB port only } @@ -27,7 +27,6 @@ void setup() { // send an intro: Serial.println("\n\nComparing Strings:"); Serial.println(); - } void loop() { @@ -122,7 +121,6 @@ void loop() { Serial.println(stringOne + " comes before " + stringTwo); } else { Serial.println(stringOne + " comes after " + stringTwo); - } } } diff --git a/examples/08.Strings/StringConstructors/StringConstructors.ino b/examples/08.Strings/StringConstructors/StringConstructors.ino index 85d0024..36ff78a 100644 --- a/examples/08.Strings/StringConstructors/StringConstructors.ino +++ b/examples/08.Strings/StringConstructors/StringConstructors.ino @@ -16,7 +16,7 @@ void setup() { // Open serial communications and wait for port to open: Serial.begin(9600); while (!Serial) { - ; // wait for serial port to connect. Needed for native USB port only + ; // wait for serial port to connect. Needed for native USB port only } // send an intro: @@ -27,42 +27,42 @@ void setup() { void loop() { // using a constant String: String stringOne = "Hello String"; - Serial.println(stringOne); // prints "Hello String" + Serial.println(stringOne); // prints "Hello String" // converting a constant char into a String: - stringOne = String('a'); - Serial.println(stringOne); // prints "a" + stringOne = String('a'); + Serial.println(stringOne); // prints "a" // converting a constant string into a String object: - String stringTwo = String("This is a string"); - Serial.println(stringTwo); // prints "This is a string" + String stringTwo = String("This is a string"); + Serial.println(stringTwo); // prints "This is a string" // concatenating two strings: - stringOne = String(stringTwo + " with more"); + stringOne = String(stringTwo + " with more"); // prints "This is a string with more": Serial.println(stringOne); // using a constant integer: - stringOne = String(13); - Serial.println(stringOne); // prints "13" + stringOne = String(13); + Serial.println(stringOne); // prints "13" // using an int and a base: - stringOne = String(analogRead(A0), DEC); + stringOne = String(analogRead(A0), DEC); // prints "453" or whatever the value of analogRead(A0) is Serial.println(stringOne); // using an int and a base (hexadecimal): - stringOne = String(45, HEX); + stringOne = String(45, HEX); // prints "2d", which is the hexadecimal version of decimal 45: Serial.println(stringOne); // using an int and a base (binary) - stringOne = String(255, BIN); + stringOne = String(255, BIN); // prints "11111111" which is the binary value of 255 Serial.println(stringOne); // using a long and a base: - stringOne = String(millis(), DEC); + stringOne = String(millis(), DEC); // prints "123456" or whatever the value of millis() is: Serial.println(stringOne); @@ -75,6 +75,6 @@ void loop() { Serial.println(stringOne); // do nothing while true: - while (true); - + while (true) + ; } diff --git a/examples/08.Strings/StringIndexOf/StringIndexOf.ino b/examples/08.Strings/StringIndexOf/StringIndexOf.ino index 219f508..cf1f816 100644 --- a/examples/08.Strings/StringIndexOf/StringIndexOf.ino +++ b/examples/08.Strings/StringIndexOf/StringIndexOf.ino @@ -16,7 +16,7 @@ void setup() { // Open serial communications and wait for port to open: Serial.begin(9600); while (!Serial) { - ; // wait for serial port to connect. Needed for native USB port only + ; // wait for serial port to connect. Needed for native USB port only } // send an intro: @@ -50,7 +50,7 @@ void loop() { int lastOpeningBracket = stringOne.lastIndexOf('<'); Serial.println("The index of the last < in the string " + stringOne + " is " + lastOpeningBracket); - int lastListItem = stringOne.lastIndexOf("
  • "); + int lastListItem = stringOne.lastIndexOf("
  • "); Serial.println("The index of the last list tag in the string " + stringOne + " is " + lastListItem); @@ -61,5 +61,6 @@ void loop() { Serial.println("The index of the second to last paragraph tag " + stringOne + " is " + secondLastGraf); // do nothing while true: - while (true); + while (true) + ; } diff --git a/examples/08.Strings/StringLength/StringLength.ino b/examples/08.Strings/StringLength/StringLength.ino index ef57b74..c9378a7 100644 --- a/examples/08.Strings/StringLength/StringLength.ino +++ b/examples/08.Strings/StringLength/StringLength.ino @@ -12,14 +12,14 @@ https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringLengthTrim */ -String txtMsg = ""; // a string for incoming text -unsigned int lastStringLength = txtMsg.length(); // previous length of the String +String txtMsg = ""; // a string for incoming text +unsigned int lastStringLength = txtMsg.length(); // previous length of the String void setup() { // Open serial communications and wait for port to open: Serial.begin(9600); while (!Serial) { - ; // wait for serial port to connect. Needed for native USB port only + ; // wait for serial port to connect. Needed for native USB port only } // send an intro: diff --git a/examples/08.Strings/StringLengthTrim/StringLengthTrim.ino b/examples/08.Strings/StringLengthTrim/StringLengthTrim.ino index b253087..bdef83a 100644 --- a/examples/08.Strings/StringLengthTrim/StringLengthTrim.ino +++ b/examples/08.Strings/StringLengthTrim/StringLengthTrim.ino @@ -16,7 +16,7 @@ void setup() { // Open serial communications and wait for port to open: Serial.begin(9600); while (!Serial) { - ; // wait for serial port to connect. Needed for native USB port only + ; // wait for serial port to connect. Needed for native USB port only } // send an intro: @@ -38,5 +38,6 @@ void loop() { Serial.println(stringOne.length()); // do nothing while true: - while (true); + while (true) + ; } diff --git a/examples/08.Strings/StringReplace/StringReplace.ino b/examples/08.Strings/StringReplace/StringReplace.ino index 907f5d0..6fa9ba1 100644 --- a/examples/08.Strings/StringReplace/StringReplace.ino +++ b/examples/08.Strings/StringReplace/StringReplace.ino @@ -16,7 +16,7 @@ void setup() { // Open serial communications and wait for port to open: Serial.begin(9600); while (!Serial) { - ; // wait for serial port to connect. Needed for native USB port only + ; // wait for serial port to connect. Needed for native USB port only } // send an intro: @@ -46,5 +46,6 @@ void loop() { Serial.println("l33tspeak: " + leetString); // do nothing while true: - while (true); + while (true) + ; } diff --git a/examples/08.Strings/StringStartsWithEndsWith/StringStartsWithEndsWith.ino b/examples/08.Strings/StringStartsWithEndsWith/StringStartsWithEndsWith.ino index ff5563c..9cdbe24 100644 --- a/examples/08.Strings/StringStartsWithEndsWith/StringStartsWithEndsWith.ino +++ b/examples/08.Strings/StringStartsWithEndsWith/StringStartsWithEndsWith.ino @@ -16,7 +16,7 @@ void setup() { // Open serial communications and wait for port to open: Serial.begin(9600); while (!Serial) { - ; // wait for serial port to connect. Needed for native USB port only + ; // wait for serial port to connect. Needed for native USB port only } // send an intro: @@ -49,5 +49,6 @@ void loop() { } // do nothing while true: - while (true); + while (true) + ; } diff --git a/examples/08.Strings/StringSubstring/StringSubstring.ino b/examples/08.Strings/StringSubstring/StringSubstring.ino index 1c0854a..871da29 100644 --- a/examples/08.Strings/StringSubstring/StringSubstring.ino +++ b/examples/08.Strings/StringSubstring/StringSubstring.ino @@ -16,7 +16,7 @@ void setup() { // Open serial communications and wait for port to open: Serial.begin(9600); while (!Serial) { - ; // wait for serial port to connect. Needed for native USB port only + ; // wait for serial port to connect. Needed for native USB port only } // send an intro: @@ -39,5 +39,6 @@ void loop() { } // do nothing while true: - while (true); + while (true) + ; } diff --git a/examples/08.Strings/StringToInt/StringToInt.ino b/examples/08.Strings/StringToInt/StringToInt.ino index 81e48e5..dc10d02 100644 --- a/examples/08.Strings/StringToInt/StringToInt.ino +++ b/examples/08.Strings/StringToInt/StringToInt.ino @@ -15,13 +15,13 @@ https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringToInt */ -String inString = ""; // string to hold input +String inString = ""; // string to hold input void setup() { // Open serial communications and wait for port to open: Serial.begin(9600); while (!Serial) { - ; // wait for serial port to connect. Needed for native USB port only + ; // wait for serial port to connect. Needed for native USB port only } // send an intro: diff --git a/examples/09.USB/Keyboard/KeyboardLogout/KeyboardLogout.ino b/examples/09.USB/Keyboard/KeyboardLogout/KeyboardLogout.ino index 28c59f9..c44c509 100644 --- a/examples/09.USB/Keyboard/KeyboardLogout/KeyboardLogout.ino +++ b/examples/09.USB/Keyboard/KeyboardLogout/KeyboardLogout.ino @@ -85,5 +85,6 @@ void loop() { } // do nothing: - while (true); + while (true) + ; } diff --git a/examples/09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino b/examples/09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino index f0bd32b..fbf4adb 100644 --- a/examples/09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino +++ b/examples/09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino @@ -22,9 +22,9 @@ #include "Keyboard.h" -const int buttonPin = 4; // input pin for pushbutton -int previousButtonState = HIGH; // for checking the state of a pushButton -int counter = 0; // button push counter +const int buttonPin = 4; // input pin for pushbutton +int previousButtonState = HIGH; // for checking the state of a pushButton +int counter = 0; // button push counter void setup() { // make the pushButton pin an input: diff --git a/examples/09.USB/Keyboard/KeyboardReprogram/KeyboardReprogram.ino b/examples/09.USB/Keyboard/KeyboardReprogram/KeyboardReprogram.ino index d86f944..94efe8c 100644 --- a/examples/09.USB/Keyboard/KeyboardReprogram/KeyboardReprogram.ino +++ b/examples/09.USB/Keyboard/KeyboardReprogram/KeyboardReprogram.ino @@ -99,5 +99,6 @@ void loop() { Keyboard.releaseAll(); // wait for the sweet oblivion of reprogramming: - while (true); + while (true) + ; } diff --git a/examples/09.USB/KeyboardAndMouseControl/KeyboardAndMouseControl.ino b/examples/09.USB/KeyboardAndMouseControl/KeyboardAndMouseControl.ino index 8850067..3b1a280 100644 --- a/examples/09.USB/KeyboardAndMouseControl/KeyboardAndMouseControl.ino +++ b/examples/09.USB/KeyboardAndMouseControl/KeyboardAndMouseControl.ino @@ -31,7 +31,7 @@ const int leftButton = 4; const int rightButton = 5; const int mouseButton = 6; -void setup() { // initialize the buttons' inputs: +void setup() { // initialize the buttons' inputs: pinMode(upButton, INPUT); pinMode(downButton, INPUT); pinMode(leftButton, INPUT); @@ -89,5 +89,4 @@ void loop() { if (digitalRead(mouseButton) == HIGH) { Keyboard.write('m'); } - } diff --git a/examples/09.USB/Mouse/ButtonMouseControl/ButtonMouseControl.ino b/examples/09.USB/Mouse/ButtonMouseControl/ButtonMouseControl.ino index 2e0da7a..c27ef70 100644 --- a/examples/09.USB/Mouse/ButtonMouseControl/ButtonMouseControl.ino +++ b/examples/09.USB/Mouse/ButtonMouseControl/ButtonMouseControl.ino @@ -32,8 +32,8 @@ const int leftButton = 4; const int rightButton = 5; const int mouseButton = 6; -int range = 5; // output range of X or Y movement; affects movement speed -int responseDelay = 10; // response delay of the mouse, in ms +int range = 5; // output range of X or Y movement; affects movement speed +int responseDelay = 10; // response delay of the mouse, in ms void setup() { @@ -56,8 +56,8 @@ void loop() { int clickState = digitalRead(mouseButton); // calculate the movement distance based on the button states: - int xDistance = (leftState - rightState) * range; - int yDistance = (upState - downState) * range; + int xDistance = (leftState - rightState) * range; + int yDistance = (upState - downState) * range; // if X or Y is non-zero, move: if ((xDistance != 0) || (yDistance != 0)) { diff --git a/examples/09.USB/Mouse/JoystickMouseControl/JoystickMouseControl.ino b/examples/09.USB/Mouse/JoystickMouseControl/JoystickMouseControl.ino index 92d00f6..266ba61 100644 --- a/examples/09.USB/Mouse/JoystickMouseControl/JoystickMouseControl.ino +++ b/examples/09.USB/Mouse/JoystickMouseControl/JoystickMouseControl.ino @@ -32,24 +32,24 @@ #include "Mouse.h" // set pin numbers for switch, joystick axes, and LED: -const int switchPin = 2; // switch to turn on and off mouse control -const int mouseButton = 3; // input pin for the mouse pushButton -const int xAxis = A0; // joystick X axis -const int yAxis = A1; // joystick Y axis -const int ledPin = 5; // Mouse control LED +const int switchPin = 2; // switch to turn on and off mouse control +const int mouseButton = 3; // input pin for the mouse pushButton +const int xAxis = A0; // joystick X axis +const int yAxis = A1; // joystick Y axis +const int ledPin = 5; // Mouse control LED // parameters for reading the joystick: -int range = 12; // output range of X or Y movement -int responseDelay = 5; // response delay of the mouse, in ms -int threshold = range / 4; // resting threshold -int center = range / 2; // resting position value +int range = 12; // output range of X or Y movement +int responseDelay = 5; // response delay of the mouse, in ms +int threshold = range / 4; // resting threshold +int center = range / 2; // resting position value -bool mouseIsActive = false; // whether or not to control the mouse -int lastSwitchState = LOW; // previous switch state +bool mouseIsActive = false; // whether or not to control the mouse +int lastSwitchState = LOW; // previous switch state void setup() { - pinMode(switchPin, INPUT); // the switch pin - pinMode(ledPin, OUTPUT); // the LED pin + pinMode(switchPin, INPUT); // the switch pin + pinMode(ledPin, OUTPUT); // the LED pin // take control of the mouse: Mouse.begin(); } diff --git a/examples/10.StarterKit_BasicKit/p02_SpaceshipInterface/p02_SpaceshipInterface.ino b/examples/10.StarterKit_BasicKit/p02_SpaceshipInterface/p02_SpaceshipInterface.ino index 5acf9de..255d100 100644 --- a/examples/10.StarterKit_BasicKit/p02_SpaceshipInterface/p02_SpaceshipInterface.ino +++ b/examples/10.StarterKit_BasicKit/p02_SpaceshipInterface/p02_SpaceshipInterface.ino @@ -42,21 +42,21 @@ void loop() { // if the button is not pressed turn on the green LED and off the red LEDs if (switchstate == LOW) { - digitalWrite(3, HIGH); // turn the green LED on pin 3 on - digitalWrite(4, LOW); // turn the red LED on pin 4 off - digitalWrite(5, LOW); // turn the red LED on pin 5 off + digitalWrite(3, HIGH); // turn the green LED on pin 3 on + digitalWrite(4, LOW); // turn the red LED on pin 4 off + digitalWrite(5, LOW); // turn the red LED on pin 5 off } // this else is part of the above if() statement. // if the switch is not LOW (the button is pressed) turn off the green LED and // blink alternatively the red LEDs else { - digitalWrite(3, LOW); // turn the green LED on pin 3 off - digitalWrite(4, LOW); // turn the red LED on pin 4 off - digitalWrite(5, HIGH); // turn the red LED on pin 5 on + digitalWrite(3, LOW); // turn the green LED on pin 3 off + digitalWrite(4, LOW); // turn the red LED on pin 4 off + digitalWrite(5, HIGH); // turn the red LED on pin 5 on // wait for a quarter second before changing the light delay(250); - digitalWrite(4, HIGH); // turn the red LED on pin 4 on - digitalWrite(5, LOW); // turn the red LED on pin 5 off + digitalWrite(4, HIGH); // turn the red LED on pin 4 on + digitalWrite(5, LOW); // turn the red LED on pin 5 off // wait for a quarter second before changing the light delay(250); } diff --git a/examples/10.StarterKit_BasicKit/p03_LoveOMeter/p03_LoveOMeter.ino b/examples/10.StarterKit_BasicKit/p03_LoveOMeter/p03_LoveOMeter.ino index 57959ed..e8390a3 100644 --- a/examples/10.StarterKit_BasicKit/p03_LoveOMeter/p03_LoveOMeter.ino +++ b/examples/10.StarterKit_BasicKit/p03_LoveOMeter/p03_LoveOMeter.ino @@ -61,17 +61,17 @@ void loop() { digitalWrite(2, LOW); digitalWrite(3, LOW); digitalWrite(4, LOW); - } // if the temperature rises 2-4 degrees, turn an LED on + } // if the temperature rises 2-4 degrees, turn an LED on else if (temperature >= baselineTemp + 2 && temperature < baselineTemp + 4) { digitalWrite(2, HIGH); digitalWrite(3, LOW); digitalWrite(4, LOW); - } // if the temperature rises 4-6 degrees, turn a second LED on + } // if the temperature rises 4-6 degrees, turn a second LED on else if (temperature >= baselineTemp + 4 && temperature < baselineTemp + 6) { digitalWrite(2, HIGH); digitalWrite(3, HIGH); digitalWrite(4, LOW); - } // if the temperature rises more than 6 degrees, turn all LEDs on + } // if the temperature rises more than 6 degrees, turn all LEDs on else if (temperature >= baselineTemp + 6) { digitalWrite(2, HIGH); digitalWrite(3, HIGH); diff --git a/examples/10.StarterKit_BasicKit/p04_ColorMixingLamp/p04_ColorMixingLamp.ino b/examples/10.StarterKit_BasicKit/p04_ColorMixingLamp/p04_ColorMixingLamp.ino index 09f3121..8efc411 100644 --- a/examples/10.StarterKit_BasicKit/p04_ColorMixingLamp/p04_ColorMixingLamp.ino +++ b/examples/10.StarterKit_BasicKit/p04_ColorMixingLamp/p04_ColorMixingLamp.ino @@ -21,21 +21,21 @@ This example code is part of the public domain. */ -const int greenLEDPin = 9; // LED connected to digital pin 9 -const int redLEDPin = 10; // LED connected to digital pin 10 -const int blueLEDPin = 11; // LED connected to digital pin 11 +const int greenLEDPin = 9; // LED connected to digital pin 9 +const int redLEDPin = 10; // LED connected to digital pin 10 +const int blueLEDPin = 11; // LED connected to digital pin 11 -const int redSensorPin = A0; // pin with the photoresistor with the red gel -const int greenSensorPin = A1; // pin with the photoresistor with the green gel +const int redSensorPin = A0; // pin with the photoresistor with the red gel +const int greenSensorPin = A1; // pin with the photoresistor with the green gel const int blueSensorPin = A2; // pin with the photoresistor with the blue gel -int redValue = 0; // value to write to the red LED -int greenValue = 0; // value to write to the green LED -int blueValue = 0; // value to write to the blue LED +int redValue = 0; // value to write to the red LED +int greenValue = 0; // value to write to the green LED +int blueValue = 0; // value to write to the blue LED -int redSensorValue = 0; // variable to hold the value from the red sensor -int greenSensorValue = 0; // variable to hold the value from the green sensor -int blueSensorValue = 0; // variable to hold the value from the blue sensor +int redSensorValue = 0; // variable to hold the value from the red sensor +int greenSensorValue = 0; // variable to hold the value from the green sensor +int blueSensorValue = 0; // variable to hold the value from the blue sensor void setup() { // initialize serial communications at 9600 bps: diff --git a/examples/10.StarterKit_BasicKit/p05_ServoMoodIndicator/p05_ServoMoodIndicator.ino b/examples/10.StarterKit_BasicKit/p05_ServoMoodIndicator/p05_ServoMoodIndicator.ino index 9e042ed..5e2ccf3 100644 --- a/examples/10.StarterKit_BasicKit/p05_ServoMoodIndicator/p05_ServoMoodIndicator.ino +++ b/examples/10.StarterKit_BasicKit/p05_ServoMoodIndicator/p05_ServoMoodIndicator.ino @@ -22,17 +22,17 @@ Servo myServo; // create a servo object -int const potPin = A0; // analog pin used to connect the potentiometer -int potVal; // variable to read the value from the analog pin -int angle; // variable to hold the angle for the servo motor +int const potPin = A0; // analog pin used to connect the potentiometer +int potVal; // variable to read the value from the analog pin +int angle; // variable to hold the angle for the servo motor void setup() { - myServo.attach(9); // attaches the servo on pin 9 to the servo object - Serial.begin(9600); // open a serial connection to your computer + myServo.attach(9); // attaches the servo on pin 9 to the servo object + Serial.begin(9600); // open a serial connection to your computer } void loop() { - potVal = analogRead(potPin); // read the value of the potentiometer + potVal = analogRead(potPin); // read the value of the potentiometer // print out the value to the Serial Monitor Serial.print("potVal: "); Serial.print(potVal); diff --git a/examples/10.StarterKit_BasicKit/p07_Keyboard/p07_Keyboard.ino b/examples/10.StarterKit_BasicKit/p07_Keyboard/p07_Keyboard.ino index bf53da7..f6b6fb3 100644 --- a/examples/10.StarterKit_BasicKit/p07_Keyboard/p07_Keyboard.ino +++ b/examples/10.StarterKit_BasicKit/p07_Keyboard/p07_Keyboard.ino @@ -21,7 +21,7 @@ // create an array of notes // the numbers below correspond to the frequencies of middle C, D, E, and F -int notes[] = {262, 294, 330, 349}; +int notes[] = { 262, 294, 330, 349 }; void setup() { //start serial communication diff --git a/examples/10.StarterKit_BasicKit/p08_DigitalHourglass/p08_DigitalHourglass.ino b/examples/10.StarterKit_BasicKit/p08_DigitalHourglass/p08_DigitalHourglass.ino index 0d7004b..9fbbc18 100644 --- a/examples/10.StarterKit_BasicKit/p08_DigitalHourglass/p08_DigitalHourglass.ino +++ b/examples/10.StarterKit_BasicKit/p08_DigitalHourglass/p08_DigitalHourglass.ino @@ -21,13 +21,13 @@ // named constant for the switch pin const int switchPin = 8; -unsigned long previousTime = 0; // store the last time an LED was updated -int switchState = 0; // the current switch state -int prevSwitchState = 0; // the previous switch state -int led = 2; // a variable to refer to the LEDs +unsigned long previousTime = 0; // store the last time an LED was updated +int switchState = 0; // the current switch state +int prevSwitchState = 0; // the previous switch state +int led = 2; // a variable to refer to the LEDs // 600000 = 10 minutes in milliseconds -long interval = 600000; // interval at which to light the next LED +long interval = 600000; // interval at which to light the next LED void setup() { // set the LED pins as outputs diff --git a/examples/10.StarterKit_BasicKit/p09_MotorizedPinwheel/p09_MotorizedPinwheel.ino b/examples/10.StarterKit_BasicKit/p09_MotorizedPinwheel/p09_MotorizedPinwheel.ino index 56c465d..8841d32 100644 --- a/examples/10.StarterKit_BasicKit/p09_MotorizedPinwheel/p09_MotorizedPinwheel.ino +++ b/examples/10.StarterKit_BasicKit/p09_MotorizedPinwheel/p09_MotorizedPinwheel.ino @@ -21,8 +21,8 @@ */ // named constants for the switch and motor pins -const int switchPin = 2; // the number of the switch pin -const int motorPin = 9; // the number of the motor pin +const int switchPin = 2; // the number of the switch pin +const int motorPin = 9; // the number of the motor pin int switchState = 0; // variable for reading the switch's status diff --git a/examples/10.StarterKit_BasicKit/p10_Zoetrope/p10_Zoetrope.ino b/examples/10.StarterKit_BasicKit/p10_Zoetrope/p10_Zoetrope.ino index 69ac37e..9b9991f 100644 --- a/examples/10.StarterKit_BasicKit/p10_Zoetrope/p10_Zoetrope.ino +++ b/examples/10.StarterKit_BasicKit/p10_Zoetrope/p10_Zoetrope.ino @@ -21,22 +21,22 @@ This example code is part of the public domain. */ -const int controlPin1 = 2; // connected to pin 7 on the H-bridge -const int controlPin2 = 3; // connected to pin 2 on the H-bridge -const int enablePin = 9; // connected to pin 1 on the H-bridge -const int directionSwitchPin = 4; // connected to the switch for direction -const int onOffSwitchStateSwitchPin = 5; // connected to the switch for turning the motor on and off -const int potPin = A0; // connected to the potentiometer's output +const int controlPin1 = 2; // connected to pin 7 on the H-bridge +const int controlPin2 = 3; // connected to pin 2 on the H-bridge +const int enablePin = 9; // connected to pin 1 on the H-bridge +const int directionSwitchPin = 4; // connected to the switch for direction +const int onOffSwitchStateSwitchPin = 5; // connected to the switch for turning the motor on and off +const int potPin = A0; // connected to the potentiometer's output // create some variables to hold values from your inputs -int onOffSwitchState = 0; // current state of the on/off switch -int previousOnOffSwitchState = 0; // previous position of the on/off switch -int directionSwitchState = 0; // current state of the direction switch +int onOffSwitchState = 0; // current state of the on/off switch +int previousOnOffSwitchState = 0; // previous position of the on/off switch +int directionSwitchState = 0; // current state of the direction switch int previousDirectionSwitchState = 0; // previous state of the direction switch -int motorEnabled = 0; // Turns the motor on/off -int motorSpeed = 0; // speed of the motor -int motorDirection = 1; // current direction of the motor +int motorEnabled = 0; // Turns the motor on/off +int motorSpeed = 0; // speed of the motor +int motorDirection = 1; // current direction of the motor void setup() { // initialize the inputs and outputs @@ -92,7 +92,7 @@ void loop() { if (motorEnabled == 1) { // PWM the enable pin to vary the speed analogWrite(enablePin, motorSpeed); - } else { // if the motor is not supposed to be on + } else { // if the motor is not supposed to be on //turn the motor off analogWrite(enablePin, 0); } diff --git a/examples/10.StarterKit_BasicKit/p12_KnockLock/p12_KnockLock.ino b/examples/10.StarterKit_BasicKit/p12_KnockLock/p12_KnockLock.ino index a952307..6401ac9 100644 --- a/examples/10.StarterKit_BasicKit/p12_KnockLock/p12_KnockLock.ino +++ b/examples/10.StarterKit_BasicKit/p12_KnockLock/p12_KnockLock.ino @@ -30,11 +30,11 @@ // create an instance of the Servo library Servo myServo; -const int piezo = A0; // pin the piezo is attached to -const int switchPin = 2; // pin the switch is attached to -const int yellowLed = 3; // pin the yellow LED is attached to -const int greenLed = 4; // pin the green LED is attached to -const int redLed = 5; // pin the red LED is attached to +const int piezo = A0; // pin the piezo is attached to +const int switchPin = 2; // pin the switch is attached to +const int yellowLed = 3; // pin the yellow LED is attached to +const int greenLed = 4; // pin the green LED is attached to +const int redLed = 5; // pin the red LED is attached to // variable for the piezo value int knockVal; diff --git a/examples/10.StarterKit_BasicKit/p15_HackingButtons/p15_HackingButtons.ino b/examples/10.StarterKit_BasicKit/p15_HackingButtons/p15_HackingButtons.ino index 28daed0..9db4bbf 100644 --- a/examples/10.StarterKit_BasicKit/p15_HackingButtons/p15_HackingButtons.ino +++ b/examples/10.StarterKit_BasicKit/p15_HackingButtons/p15_HackingButtons.ino @@ -17,7 +17,7 @@ This example code is part of the public domain. */ -const int optoPin = 2; // the pin the optocoupler is connected to +const int optoPin = 2; // the pin the optocoupler is connected to void setup() { // make the pin with the optocoupler an output @@ -27,7 +27,7 @@ void setup() { void loop() { digitalWrite(optoPin, HIGH); // pull pin 2 HIGH, activating the optocoupler - delay(15); // give the optocoupler a moment to activate + delay(15); // give the optocoupler a moment to activate digitalWrite(optoPin, LOW); // pull pin 2 low until you're ready to activate again delay(21000); // wait for 21 seconds diff --git a/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino b/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino index 3f84d6b..c75d233 100644 --- a/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino +++ b/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino @@ -50,7 +50,7 @@ // // A clock slow enough for an ATtiny85 @ 1 MHz, is a reasonable default: -#define SPI_CLOCK (1000000/6) +#define SPI_CLOCK (1000000 / 6) // Select hardware or software SPI, depending on SPI clock. @@ -59,9 +59,9 @@ #if defined(ARDUINO_ARCH_AVR) - #if SPI_CLOCK > (F_CPU / 128) - #define USE_HARDWARE_SPI - #endif +#if SPI_CLOCK > (F_CPU / 128) +#define USE_HARDWARE_SPI +#endif #endif @@ -70,51 +70,51 @@ // The standard pin configuration. #ifndef ARDUINO_HOODLOADER2 - #define RESET 10 // Use pin 10 to reset the target rather than SS - #define LED_HB 9 - #define LED_ERR 8 - #define LED_PMODE 7 +#define RESET 10 // Use pin 10 to reset the target rather than SS +#define LED_HB 9 +#define LED_ERR 8 +#define LED_PMODE 7 - // Uncomment following line to use the old Uno style wiring - // (using pin 11, 12 and 13 instead of the SPI header) on Leonardo, Due... +// Uncomment following line to use the old Uno style wiring +// (using pin 11, 12 and 13 instead of the SPI header) on Leonardo, Due... - // #define USE_OLD_STYLE_WIRING +// #define USE_OLD_STYLE_WIRING - #ifdef USE_OLD_STYLE_WIRING +#ifdef USE_OLD_STYLE_WIRING - #define PIN_MOSI 11 - #define PIN_MISO 12 - #define PIN_SCK 13 +#define PIN_MOSI 11 +#define PIN_MISO 12 +#define PIN_SCK 13 - #endif +#endif - // HOODLOADER2 means running sketches on the ATmega16U2 serial converter chips - // on Uno or Mega boards. We must use pins that are broken out: +// HOODLOADER2 means running sketches on the ATmega16U2 serial converter chips +// on Uno or Mega boards. We must use pins that are broken out: #else - #define RESET 4 - #define LED_HB 7 - #define LED_ERR 6 - #define LED_PMODE 5 +#define RESET 4 +#define LED_HB 7 +#define LED_ERR 6 +#define LED_PMODE 5 #endif // By default, use hardware SPI pins: #ifndef PIN_MOSI - #define PIN_MOSI MOSI +#define PIN_MOSI MOSI #endif #ifndef PIN_MISO - #define PIN_MISO MISO +#define PIN_MISO MISO #endif #ifndef PIN_SCK - #define PIN_SCK SCK +#define PIN_SCK SCK #endif // Force bitbanged SPI if not using the hardware SPI pins: -#if (PIN_MISO != MISO) || (PIN_MOSI != MOSI) || (PIN_SCK != SCK) - #undef USE_HARDWARE_SPI +#if (PIN_MISO != MISO) || (PIN_MOSI != MOSI) || (PIN_SCK != SCK) +#undef USE_HARDWARE_SPI #endif @@ -131,15 +131,15 @@ // To use 'Serial': #define SERIAL Serial #ifdef SERIAL_PORT_USBVIRTUAL - #define SERIAL SERIAL_PORT_USBVIRTUAL +#define SERIAL SERIAL_PORT_USBVIRTUAL #else - #define SERIAL Serial +#define SERIAL Serial #endif // Configure the baud rate: -#define BAUDRATE 19200 +#define BAUDRATE 19200 // #define BAUDRATE 115200 // #define BAUDRATE 1000000 @@ -149,12 +149,12 @@ #define SWMIN 18 // STK Definitions -#define STK_OK 0x10 -#define STK_FAILED 0x11 +#define STK_OK 0x10 +#define STK_FAILED 0x11 #define STK_UNKNOWN 0x12 -#define STK_INSYNC 0x14 -#define STK_NOSYNC 0x15 -#define CRC_EOP 0x20 //ok it is a space... +#define STK_INSYNC 0x14 +#define STK_NOSYNC 0x15 +#define CRC_EOP 0x20 //ok it is a space... void pulse(int pin, int times); @@ -164,57 +164,58 @@ void pulse(int pin, int times); #define SPI_MODE0 0x00 -#if !defined(ARDUINO_API_VERSION) || ARDUINO_API_VERSION != 10001 // A SPISettings class is declared by ArduinoCore-API 1.0.1 +#if !defined(ARDUINO_API_VERSION) || ARDUINO_API_VERSION != 10001 // A SPISettings class is declared by ArduinoCore-API 1.0.1 class SPISettings { - public: - // clock is in Hz - SPISettings(uint32_t clock, uint8_t bitOrder, uint8_t dataMode) : clockFreq(clock) { - (void) bitOrder; - (void) dataMode; - }; - - uint32_t getClockFreq() const { - return clockFreq; - } +public: + // clock is in Hz + SPISettings(uint32_t clock, uint8_t bitOrder, uint8_t dataMode) + : clockFreq(clock) { + (void)bitOrder; + (void)dataMode; + }; + + uint32_t getClockFreq() const { + return clockFreq; + } - private: - uint32_t clockFreq; +private: + uint32_t clockFreq; }; -#endif // !defined(ARDUINO_API_VERSION) +#endif // !defined(ARDUINO_API_VERSION) class BitBangedSPI { - public: - void begin() { - digitalWrite(PIN_SCK, LOW); - digitalWrite(PIN_MOSI, LOW); - pinMode(PIN_SCK, OUTPUT); - pinMode(PIN_MOSI, OUTPUT); - pinMode(PIN_MISO, INPUT); - } +public: + void begin() { + digitalWrite(PIN_SCK, LOW); + digitalWrite(PIN_MOSI, LOW); + pinMode(PIN_SCK, OUTPUT); + pinMode(PIN_MOSI, OUTPUT); + pinMode(PIN_MISO, INPUT); + } - void beginTransaction(SPISettings settings) { - pulseWidth = (500000 + settings.getClockFreq() - 1) / settings.getClockFreq(); - if (pulseWidth == 0) { - pulseWidth = 1; - } + void beginTransaction(SPISettings settings) { + pulseWidth = (500000 + settings.getClockFreq() - 1) / settings.getClockFreq(); + if (pulseWidth == 0) { + pulseWidth = 1; } + } - void end() {} + void end() {} - uint8_t transfer(uint8_t b) { - for (unsigned int i = 0; i < 8; ++i) { - digitalWrite(PIN_MOSI, (b & 0x80) ? HIGH : LOW); - digitalWrite(PIN_SCK, HIGH); - delayMicroseconds(pulseWidth); - b = (b << 1) | digitalRead(PIN_MISO); - digitalWrite(PIN_SCK, LOW); // slow pulse - delayMicroseconds(pulseWidth); - } - return b; + uint8_t transfer(uint8_t b) { + for (unsigned int i = 0; i < 8; ++i) { + digitalWrite(PIN_MOSI, (b & 0x80) ? HIGH : LOW); + digitalWrite(PIN_SCK, HIGH); + delayMicroseconds(pulseWidth); + b = (b << 1) | digitalRead(PIN_MISO); + digitalWrite(PIN_SCK, LOW); // slow pulse + delayMicroseconds(pulseWidth); } + return b; + } - private: - unsigned long pulseWidth; // in microseconds +private: + unsigned long pulseWidth; // in microseconds }; static BitBangedSPI SPI; @@ -230,16 +231,15 @@ void setup() { pulse(LED_ERR, 2); pinMode(LED_HB, OUTPUT); pulse(LED_HB, 2); - } int ISPError = 0; int pmode = 0; // address for reading and writing, set by 'U' command unsigned int here; -uint8_t buff[256]; // global block storage +uint8_t buff[256]; // global block storage -#define beget16(addr) (*addr * 256 + *(addr+1) ) +#define beget16(addr) (*addr * 256 + *(addr + 1)) typedef struct param { uint8_t devicecode; uint8_t revision; @@ -254,8 +254,7 @@ typedef struct param { uint16_t pagesize; uint16_t eepromsize; uint32_t flashsize; -} -parameter; +} parameter; parameter param; @@ -307,7 +306,8 @@ void loop(void) { } uint8_t getch() { - while (!SERIAL.available()); + while (!SERIAL.available()) + ; return SERIAL.read(); } void fill(int n) { @@ -372,7 +372,7 @@ void get_version(uint8_t c) { breply(SWMIN); break; case 0x93: - breply('S'); // serial programmer + breply('S'); // serial programmer break; default: breply(0); @@ -382,18 +382,18 @@ void get_version(uint8_t c) { void set_parameters() { // call this after reading parameter packet into buff[] param.devicecode = buff[0]; - param.revision = buff[1]; - param.progtype = buff[2]; - param.parmode = buff[3]; - param.polling = buff[4]; - param.selftimed = buff[5]; - param.lockbytes = buff[6]; - param.fusebytes = buff[7]; - param.flashpoll = buff[8]; + param.revision = buff[1]; + param.progtype = buff[2]; + param.parmode = buff[3]; + param.polling = buff[4]; + param.selftimed = buff[5]; + param.lockbytes = buff[6]; + param.fusebytes = buff[7]; + param.flashpoll = buff[8]; // ignore buff[9] (= buff[8]) // following are 16 bits (big endian) param.eeprompoll = beget16(&buff[10]); - param.pagesize = beget16(&buff[12]); + param.pagesize = beget16(&buff[12]); param.eepromsize = beget16(&buff[14]); // 32 bits flashsize (big endian) @@ -423,7 +423,7 @@ void start_pmode() { // Pulse RESET after PIN_SCK is low: digitalWrite(PIN_SCK, LOW); - delay(20); // discharge PIN_SCK, value arbitrarily chosen + delay(20); // discharge PIN_SCK, value arbitrarily chosen reset_target(false); // Pulse must be minimum 2 target CPU clock cycles so 100 usec is ok for CPU // speeds above 20 KHz @@ -431,7 +431,7 @@ void start_pmode() { reset_target(true); // Send the enable programming command: - delay(50); // datasheet: must be > 20 msec + delay(50); // datasheet: must be > 20 msec spi_transaction(0xAC, 0x53, 0x00, 0x00); pmode = 1; } @@ -491,11 +491,11 @@ unsigned int current_page() { void write_flash(int length) { fill(length); if (CRC_EOP == getch()) { - SERIAL.print((char) STK_INSYNC); - SERIAL.print((char) write_flash_pages(length)); + SERIAL.print((char)STK_INSYNC); + SERIAL.print((char)write_flash_pages(length)); } else { ISPError++; - SERIAL.print((char) STK_NOSYNC); + SERIAL.print((char)STK_NOSYNC); } } @@ -549,7 +549,7 @@ uint8_t write_eeprom_chunk(unsigned int start, unsigned int length) { } void program_page() { - char result = (char) STK_FAILED; + char result = (char)STK_FAILED; unsigned int length = 256 * getch(); length += getch(); char memtype = getch(); @@ -561,11 +561,11 @@ void program_page() { if (memtype == 'E') { result = (char)write_eeprom(length); if (CRC_EOP == getch()) { - SERIAL.print((char) STK_INSYNC); + SERIAL.print((char)STK_INSYNC); SERIAL.print(result); } else { ISPError++; - SERIAL.print((char) STK_NOSYNC); + SERIAL.print((char)STK_NOSYNC); } return; } @@ -583,9 +583,9 @@ uint8_t flash_read(uint8_t hilo, unsigned int addr) { char flash_read_page(int length) { for (int x = 0; x < length; x += 2) { uint8_t low = flash_read(LOW, here); - SERIAL.print((char) low); + SERIAL.print((char)low); uint8_t high = flash_read(HIGH, here); - SERIAL.print((char) high); + SERIAL.print((char)high); here++; } return STK_OK; @@ -597,7 +597,7 @@ char eeprom_read_page(int length) { for (int x = 0; x < length; x++) { int addr = start + x; uint8_t ee = spi_transaction(0xA0, (addr >> 8) & 0xFF, addr & 0xFF, 0xFF); - SERIAL.print((char) ee); + SERIAL.print((char)ee); } return STK_OK; } @@ -609,10 +609,10 @@ void read_page() { char memtype = getch(); if (CRC_EOP != getch()) { ISPError++; - SERIAL.print((char) STK_NOSYNC); + SERIAL.print((char)STK_NOSYNC); return; } - SERIAL.print((char) STK_INSYNC); + SERIAL.print((char)STK_INSYNC); if (memtype == 'F') { result = flash_read_page(length); } @@ -625,17 +625,17 @@ void read_page() { void read_signature() { if (CRC_EOP != getch()) { ISPError++; - SERIAL.print((char) STK_NOSYNC); + SERIAL.print((char)STK_NOSYNC); return; } - SERIAL.print((char) STK_INSYNC); + SERIAL.print((char)STK_INSYNC); uint8_t high = spi_transaction(0x30, 0x00, 0x00, 0x00); - SERIAL.print((char) high); + SERIAL.print((char)high); uint8_t middle = spi_transaction(0x30, 0x00, 0x01, 0x00); - SERIAL.print((char) middle); + SERIAL.print((char)middle); uint8_t low = spi_transaction(0x30, 0x00, 0x02, 0x00); - SERIAL.print((char) low); - SERIAL.print((char) STK_OK); + SERIAL.print((char)low); + SERIAL.print((char)STK_OK); } ////////////////////////////////////////// ////////////////////////////////////////// @@ -646,18 +646,18 @@ void read_signature() { void avrisp() { uint8_t ch = getch(); switch (ch) { - case '0': // signon + case '0': // signon ISPError = 0; empty_reply(); break; case '1': if (getch() == CRC_EOP) { - SERIAL.print((char) STK_INSYNC); + SERIAL.print((char)STK_INSYNC); SERIAL.print("AVR ISP"); - SERIAL.print((char) STK_OK); + SERIAL.print((char)STK_OK); } else { ISPError++; - SERIAL.print((char) STK_NOSYNC); + SERIAL.print((char)STK_NOSYNC); } break; case 'A': @@ -668,7 +668,7 @@ void avrisp() { set_parameters(); empty_reply(); break; - case 'E': // extended parameters - ignore for now + case 'E': // extended parameters - ignore for now fill(5); empty_reply(); break; @@ -678,40 +678,40 @@ void avrisp() { } empty_reply(); break; - case 'U': // set address (word) + case 'U': // set address (word) here = getch(); here += 256 * getch(); empty_reply(); break; - case 0x60: //STK_PROG_FLASH - getch(); // low addr - getch(); // high addr + case 0x60: //STK_PROG_FLASH + getch(); // low addr + getch(); // high addr empty_reply(); break; - case 0x61: //STK_PROG_DATA - getch(); // data + case 0x61: //STK_PROG_DATA + getch(); // data empty_reply(); break; - case 0x64: //STK_PROG_PAGE + case 0x64: //STK_PROG_PAGE program_page(); break; - case 0x74: //STK_READ_PAGE 't' + case 0x74: //STK_READ_PAGE 't' read_page(); break; - case 'V': //0x56 + case 'V': //0x56 universal(); break; - case 'Q': //0x51 + case 'Q': //0x51 ISPError = 0; end_pmode(); empty_reply(); break; - case 0x75: //STK_READ_SIGN 'u' + case 0x75: //STK_READ_SIGN 'u' read_signature(); break; @@ -719,7 +719,7 @@ void avrisp() { // this is how we can get back in sync case CRC_EOP: ISPError++; - SERIAL.print((char) STK_NOSYNC); + SERIAL.print((char)STK_NOSYNC); break; // anything else we will return STK_UNKNOWN diff --git a/examples_formatter.conf b/examples_formatter.conf deleted file mode 100644 index e006d1f..0000000 --- a/examples_formatter.conf +++ /dev/null @@ -1,45 +0,0 @@ -# This configuration file contains a selection of the available options provided by the formatting tool "Artistic Style" -# http://astyle.sourceforge.net/astyle.html -# -# If you wish to change them, don't edit this file. -# Instead, copy it in the same folder of file "preferences.txt" and modify the copy. This way, you won't lose your custom formatter settings when upgrading the IDE -# If you don't know where file preferences.txt is stored, open the IDE, File -> Preferences and you'll find a link - -mode=c - -# 2 spaces indentation -indent=spaces=2 - -# also indent macros -indent-preprocessor - -# indent classes, switches (and cases), comments starting at column 1 -indent-classes -indent-switches -indent-cases -indent-col1-comments - -# put a space around operators -pad-oper - -# put a space after if/for/while -pad-header - -# if you like one-liners, keep them -keep-one-line-statements - -style=java -attach-namespaces -attach-classes -attach-inlines -attach-extern-c -indent-modifiers -indent-namespaces -indent-labels -indent-preproc-block -indent-preproc-define -indent-preproc-cond -unpad-paren -add-brackets -remove-comment-prefix - diff --git a/examples_formatter.sh b/examples_formatter.sh index 475c2a4..23ecfe8 100755 --- a/examples_formatter.sh +++ b/examples_formatter.sh @@ -1,5 +1,5 @@ -if ! which astyle &>/dev/null; then - echo "astyle not found or not in PATH. Please install: https://astyle.sourceforge.net/install.html" +if ! which clang-format &>/dev/null; then + echo "clang-format not found or not in PATH. Please install: https://github.com/arduino/clang-static-binaries/releases" exit 1 fi @@ -15,6 +15,8 @@ find \ \) \ -type f \ -exec \ - astyle \ - --options=examples_formatter.conf \ + clang-format \ + --assume-filename=foo.cpp \ + -i \ + --style=file \ {} \; From dfbe14a6d8cd8aaa830dbd54f5d2d58a39c78b72 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Oct 2022 18:49:56 +0000 Subject: [PATCH 36/59] Bump geekyeggo/delete-artifact from 1 to 2 Bumps [geekyeggo/delete-artifact](https://github.com/geekyeggo/delete-artifact) from 1 to 2. - [Release notes](https://github.com/geekyeggo/delete-artifact/releases) - [Commits](https://github.com/geekyeggo/delete-artifact/compare/v1...v2) --- updated-dependencies: - dependency-name: geekyeggo/delete-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/sync-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 986bda6..10abaea 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -114,7 +114,7 @@ jobs: path: ${{ env.CONFIGURATIONS_FOLDER }} - name: Remove unneeded artifact - uses: geekyeggo/delete-artifact@v1 + uses: geekyeggo/delete-artifact@v2 with: name: ${{ env.CONFIGURATIONS_ARTIFACT }} From c6d8f98eb9af5bdd41ea6850a5460129fbe7b14a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Oct 2022 18:53:43 +0000 Subject: [PATCH 37/59] Bump carlosperate/download-file-action from 1 to 2 Bumps [carlosperate/download-file-action](https://github.com/carlosperate/download-file-action) from 1 to 2. - [Release notes](https://github.com/carlosperate/download-file-action/releases) - [Commits](https://github.com/carlosperate/download-file-action/compare/v1...v2) --- updated-dependencies: - dependency-name: carlosperate/download-file-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/sync-labels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 10abaea..94938f3 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -31,7 +31,7 @@ jobs: - name: Download JSON schema for labels configuration file id: download-schema - uses: carlosperate/download-file-action@v1 + uses: carlosperate/download-file-action@v2 with: file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/arduino-tooling-gh-label-configuration-schema.json location: ${{ runner.temp }}/label-configuration-schema @@ -65,7 +65,7 @@ jobs: steps: - name: Download - uses: carlosperate/download-file-action@v1 + uses: carlosperate/download-file-action@v2 with: file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }} From 5a1bd3feea34447851ec23c506fa79a4a1fde148 Mon Sep 17 00:00:00 2001 From: THE-Spellchecker Date: Mon, 26 Dec 2022 23:14:13 -0600 Subject: [PATCH 38/59] Corrected Comment in AnalogInput.ino --- examples/03.Analog/AnalogInput/AnalogInput.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/03.Analog/AnalogInput/AnalogInput.ino b/examples/03.Analog/AnalogInput/AnalogInput.ino index 735a8b5..923079c 100644 --- a/examples/03.Analog/AnalogInput/AnalogInput.ino +++ b/examples/03.Analog/AnalogInput/AnalogInput.ino @@ -45,6 +45,6 @@ void loop() { delay(sensorValue); // turn the ledPin off: digitalWrite(ledPin, LOW); - // stop the program for for milliseconds: + // stop the program for milliseconds: delay(sensorValue); } From 74be767c762ed3bcd44a3c39729fee4b34173d81 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 18:36:25 +0000 Subject: [PATCH 39/59] Bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/code-formatting-check.yml | 2 +- .github/workflows/compile-examples.yml | 2 +- .github/workflows/spell-check.yml | 2 +- .github/workflows/sync-labels.yml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/code-formatting-check.yml b/.github/workflows/code-formatting-check.yml index 5406dae..bb3479f 100644 --- a/.github/workflows/code-formatting-check.yml +++ b/.github/workflows/code-formatting-check.yml @@ -29,7 +29,7 @@ jobs: echo "CLANG_FORMAT_INSTALL_PATH=${{ runner.temp }}/clang-format" >> "$GITHUB_ENV" - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Download ClangFormat id: download diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 646db49..d91dde1 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -212,7 +212,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Compile examples uses: arduino/compile-sketches@v1 diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml index 6a382c5..a3af916 100644 --- a/.github/workflows/spell-check.yml +++ b/.github/workflows/spell-check.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 # See: https://github.com/codespell-project/actions-codespell/blob/master/README.md - name: Spell check diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 94938f3..9cde1ac 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -27,7 +27,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Download JSON schema for labels configuration file id: download-schema @@ -105,7 +105,7 @@ jobs: echo "::set-output name=flag::--dry-run" - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Download configuration files artifact uses: actions/download-artifact@v3 From fdbc6ba8f1041f727428f4c614a6c603b3491d5e Mon Sep 17 00:00:00 2001 From: per1234 Date: Sat, 30 Dec 2023 05:10:14 -0800 Subject: [PATCH 40/59] Add new boards to sketch compilation workflow The repository infrastructure includes a GitHub Actions workflow that compiles the examples for significant official Arduino boards. This provides a automated "smoke test" to easily get some basic validation of the sketches. Since the time the workflow was created, several new official boards have been released. Some of these boards are significantly different from the boards the workflow was compiling the examples for, which meant the workflow was not providing adequate coverage for the new boards. The workflow is hereby configured to also compile the examples for the significant new boards. --- .github/workflows/compile-examples.yml | 30 ++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index d91dde1..b184f9d 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -120,18 +120,48 @@ jobs: starter-kit: false tone: true a5: true + - fqbn: arduino:esp32:nano_nora + usb: false + serial1: true + starter-kit: false + tone: true + a5: true - fqbn: arduino:megaavr:uno2018:mode=off usb: false serial1: true starter-kit: false tone: true a5: true + - fqbn: arduino:renesas_uno:minima + usb: true + serial1: true + starter-kit: false + tone: true + a5: true + - fqbn: arduino:renesas_uno:unor4wifi + usb: true + serial1: true + starter-kit: false + tone: true + a5: true + - fqbn: arduino:renesas_portenta:portenta_c33 + usb: true + serial1: true + starter-kit: false + tone: true + a5: true - fqbn: arduino:samd:mkrzero usb: true serial1: true starter-kit: false tone: true a5: true + - fqbn: arduino:mbed_giga:giga + usb: false + serial1: true + starter-kit: false + tone: true + a5: true - fqbn: arduino:mbed_nano:nano33ble usb: false serial1: true From 9806d587c0b5f2b1b286468f0540f60524573373 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sat, 30 Dec 2023 05:14:58 -0800 Subject: [PATCH 41/59] Use distinctive names for SPI pin macros to avoid collisions The "ArduinoISP" example allows the user to define arbitrary pins for use as the signal pins on the programmer board. This is done via a set of macros. Previously, very generic names were used for these macros. This resulted in a name collision. The core for the Renesas boards also defines macros of the same name. Despite what the names might lead us to believe, the values of these macros in the core do not match the Arduino pin numbers of the SPI bus. The result was that, with the default configuration of the sketch where the USE_OLD_STYLE_WIRING macro is not defined, the sketch uses the values of the macros defined by the core as the SPI signal pins instead of the standard SPI signal pins as the user would expect when the sketch is running on an UNO R4 Minima, UNO R4 WiFi, or Portenta C33 board. This causes operations using the programmer to fail with an error like: avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x03 [...] The name collision is avoided by adding a "namespace" prefix to the macro names. --- .../11.ArduinoISP/ArduinoISP/ArduinoISP.ino | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino b/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino index c75d233..bbbcdc9 100644 --- a/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino +++ b/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino @@ -22,8 +22,8 @@ // using an Uno. (On an Uno this is not needed). // // Alternatively you can use any other digital pin by configuring -// software ('BitBanged') SPI and having appropriate defines for PIN_MOSI, -// PIN_MISO and PIN_SCK. +// software ('BitBanged') SPI and having appropriate defines for ARDUINOISP_PIN_MOSI, +// ARDUINOISP_PIN_MISO and ARDUINOISP_PIN_SCK. // // IMPORTANT: When using an Arduino that is not 5V tolerant (Due, Zero, ...) as // the programmer, make sure to not expose any of the programmer's pins to 5V. @@ -82,9 +82,9 @@ #ifdef USE_OLD_STYLE_WIRING -#define PIN_MOSI 11 -#define PIN_MISO 12 -#define PIN_SCK 13 +#define ARDUINOISP_PIN_MOSI 11 +#define ARDUINOISP_PIN_MISO 12 +#define ARDUINOISP_PIN_SCK 13 #endif @@ -100,20 +100,20 @@ #endif // By default, use hardware SPI pins: -#ifndef PIN_MOSI -#define PIN_MOSI MOSI +#ifndef ARDUINOISP_PIN_MOSI +#define ARDUINOISP_PIN_MOSI MOSI #endif -#ifndef PIN_MISO -#define PIN_MISO MISO +#ifndef ARDUINOISP_PIN_MISO +#define ARDUINOISP_PIN_MISO MISO #endif -#ifndef PIN_SCK -#define PIN_SCK SCK +#ifndef ARDUINOISP_PIN_SCK +#define ARDUINOISP_PIN_SCK SCK #endif // Force bitbanged SPI if not using the hardware SPI pins: -#if (PIN_MISO != MISO) || (PIN_MOSI != MOSI) || (PIN_SCK != SCK) +#if (ARDUINOISP_PIN_MISO != MISO) || (ARDUINOISP_PIN_MOSI != MOSI) || (ARDUINOISP_PIN_SCK != SCK) #undef USE_HARDWARE_SPI #endif @@ -186,11 +186,11 @@ private: class BitBangedSPI { public: void begin() { - digitalWrite(PIN_SCK, LOW); - digitalWrite(PIN_MOSI, LOW); - pinMode(PIN_SCK, OUTPUT); - pinMode(PIN_MOSI, OUTPUT); - pinMode(PIN_MISO, INPUT); + digitalWrite(ARDUINOISP_PIN_SCK, LOW); + digitalWrite(ARDUINOISP_PIN_MOSI, LOW); + pinMode(ARDUINOISP_PIN_SCK, OUTPUT); + pinMode(ARDUINOISP_PIN_MOSI, OUTPUT); + pinMode(ARDUINOISP_PIN_MISO, INPUT); } void beginTransaction(SPISettings settings) { @@ -204,11 +204,11 @@ public: uint8_t transfer(uint8_t b) { for (unsigned int i = 0; i < 8; ++i) { - digitalWrite(PIN_MOSI, (b & 0x80) ? HIGH : LOW); - digitalWrite(PIN_SCK, HIGH); + digitalWrite(ARDUINOISP_PIN_MOSI, (b & 0x80) ? HIGH : LOW); + digitalWrite(ARDUINOISP_PIN_SCK, HIGH); delayMicroseconds(pulseWidth); - b = (b << 1) | digitalRead(PIN_MISO); - digitalWrite(PIN_SCK, LOW); // slow pulse + b = (b << 1) | digitalRead(ARDUINOISP_PIN_MISO); + digitalWrite(ARDUINOISP_PIN_SCK, LOW); // slow pulse delayMicroseconds(pulseWidth); } return b; @@ -408,7 +408,7 @@ void set_parameters() { void start_pmode() { - // Reset target before driving PIN_SCK or PIN_MOSI + // Reset target before driving ARDUINOISP_PIN_SCK or ARDUINOISP_PIN_MOSI // SPI.begin() will configure SS as output, so SPI master mode is selected. // We have defined RESET as pin 10, which for many Arduinos is not the SS pin. @@ -421,9 +421,9 @@ void start_pmode() { // See AVR datasheets, chapter "SERIAL_PRG Programming Algorithm": - // Pulse RESET after PIN_SCK is low: - digitalWrite(PIN_SCK, LOW); - delay(20); // discharge PIN_SCK, value arbitrarily chosen + // Pulse RESET after ARDUINOISP_PIN_SCK is low: + digitalWrite(ARDUINOISP_PIN_SCK, LOW); + delay(20); // discharge ARDUINOISP_PIN_SCK, value arbitrarily chosen reset_target(false); // Pulse must be minimum 2 target CPU clock cycles so 100 usec is ok for CPU // speeds above 20 KHz @@ -439,8 +439,8 @@ void start_pmode() { void end_pmode() { SPI.end(); // We're about to take the target out of reset so configure SPI pins as input - pinMode(PIN_MOSI, INPUT); - pinMode(PIN_SCK, INPUT); + pinMode(ARDUINOISP_PIN_MOSI, INPUT); + pinMode(ARDUINOISP_PIN_SCK, INPUT); reset_target(false); pinMode(RESET, INPUT); pmode = 0; From e340bb6305811ebe5b7c3120df52357eaded09ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20S=C3=B6derby?= <35461661+karlsoderby@users.noreply.github.com> Date: Fri, 19 Jan 2024 14:43:34 +0100 Subject: [PATCH 42/59] basics category --- examples/01.Basics/AnalogReadSerial/AnalogReadSerial.ino | 2 +- examples/01.Basics/Blink/Blink.ino | 2 +- examples/01.Basics/DigitalReadSerial/DigitalReadSerial.ino | 2 +- examples/01.Basics/Fade/Fade.ino | 2 +- examples/01.Basics/ReadAnalogVoltage/ReadAnalogVoltage.ino | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/01.Basics/AnalogReadSerial/AnalogReadSerial.ino b/examples/01.Basics/AnalogReadSerial/AnalogReadSerial.ino index d1dd321..b2da80c 100644 --- a/examples/01.Basics/AnalogReadSerial/AnalogReadSerial.ino +++ b/examples/01.Basics/AnalogReadSerial/AnalogReadSerial.ino @@ -7,7 +7,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/AnalogReadSerial + https://docs.arduino.cc/built-in-examples/basics/AnalogReadSerial/ */ // the setup routine runs once when you press reset: diff --git a/examples/01.Basics/Blink/Blink.ino b/examples/01.Basics/Blink/Blink.ino index 9f8b472..89f71da 100644 --- a/examples/01.Basics/Blink/Blink.ino +++ b/examples/01.Basics/Blink/Blink.ino @@ -19,7 +19,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/Blink + https://docs.arduino.cc/built-in-examples/basics/Blink/ */ // the setup function runs once when you press reset or power the board diff --git a/examples/01.Basics/DigitalReadSerial/DigitalReadSerial.ino b/examples/01.Basics/DigitalReadSerial/DigitalReadSerial.ino index 3456f2f..170e083 100644 --- a/examples/01.Basics/DigitalReadSerial/DigitalReadSerial.ino +++ b/examples/01.Basics/DigitalReadSerial/DigitalReadSerial.ino @@ -5,7 +5,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/DigitalReadSerial + https://docs.arduino.cc/built-in-examples/basics/DigitalReadSerial/ */ // digital pin 2 has a pushbutton attached to it. Give it a name: diff --git a/examples/01.Basics/Fade/Fade.ino b/examples/01.Basics/Fade/Fade.ino index 4637979..516d526 100644 --- a/examples/01.Basics/Fade/Fade.ino +++ b/examples/01.Basics/Fade/Fade.ino @@ -10,7 +10,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/Fade + https://docs.arduino.cc/built-in-examples/basics/Fade/ */ int led = 9; // the PWM pin the LED is attached to diff --git a/examples/01.Basics/ReadAnalogVoltage/ReadAnalogVoltage.ino b/examples/01.Basics/ReadAnalogVoltage/ReadAnalogVoltage.ino index 26e91e5..8e13468 100644 --- a/examples/01.Basics/ReadAnalogVoltage/ReadAnalogVoltage.ino +++ b/examples/01.Basics/ReadAnalogVoltage/ReadAnalogVoltage.ino @@ -7,7 +7,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/ReadAnalogVoltage + https://docs.arduino.cc/built-in-examples/basics/ReadAnalogVoltage/ */ // the setup routine runs once when you press reset: From 1447c5b5706415aedcda0b6d0c13f26cfde7c220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20S=C3=B6derby?= <35461661+karlsoderby@users.noreply.github.com> Date: Fri, 19 Jan 2024 14:46:25 +0100 Subject: [PATCH 43/59] digital --- examples/01.Basics/Blink/Blink.ino | 2 +- examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino | 4 ++-- examples/02.Digital/Button/Button.ino | 2 +- examples/02.Digital/Debounce/Debounce.ino | 2 +- examples/02.Digital/DigitalInputPullup/DigitalInputPullup.ino | 2 +- .../02.Digital/StateChangeDetection/StateChangeDetection.ino | 2 +- examples/02.Digital/toneKeyboard/toneKeyboard.ino | 2 +- examples/02.Digital/toneMelody/toneMelody.ino | 2 +- examples/02.Digital/toneMultiple/toneMultiple.ino | 2 +- examples/02.Digital/tonePitchFollower/tonePitchFollower.ino | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/01.Basics/Blink/Blink.ino b/examples/01.Basics/Blink/Blink.ino index 89f71da..eb03a1e 100644 --- a/examples/01.Basics/Blink/Blink.ino +++ b/examples/01.Basics/Blink/Blink.ino @@ -8,7 +8,7 @@ the correct LED pin independent of which board is used. If you want to know what pin the on-board LED is connected to on your Arduino model, check the Technical Specs of your board at: - https://www.arduino.cc/en/Main/Products + https://docs.arduino.cc/hardware/ modified 8 May 2014 by Scott Fitzgerald diff --git a/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino b/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino index d266349..63bebe2 100644 --- a/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino +++ b/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino @@ -12,7 +12,7 @@ is set to the correct LED pin independent of which board is used. If you want to know what pin the on-board LED is connected to on your Arduino model, check the Technical Specs of your board at: - https://www.arduino.cc/en/Main/Products + https://docs.arduino.cc/hardware/ created 2005 by David A. Mellis @@ -25,7 +25,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/BlinkWithoutDelay + https://docs.arduino.cc/built-in-examples/digital/BlinkWithoutDelay/ */ // constants won't change. Used here to set a pin number: diff --git a/examples/02.Digital/Button/Button.ino b/examples/02.Digital/Button/Button.ino index e041c31..947f83f 100644 --- a/examples/02.Digital/Button/Button.ino +++ b/examples/02.Digital/Button/Button.ino @@ -19,7 +19,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/Button + https://docs.arduino.cc/built-in-examples/digital/Button/ */ // constants won't change. They're used here to set pin numbers: diff --git a/examples/02.Digital/Debounce/Debounce.ino b/examples/02.Digital/Debounce/Debounce.ino index 6460d90..b091de4 100644 --- a/examples/02.Digital/Debounce/Debounce.ino +++ b/examples/02.Digital/Debounce/Debounce.ino @@ -24,7 +24,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/Debounce + https://docs.arduino.cc/built-in-examples/digital/Debounce/ */ // constants won't change. They're used here to set pin numbers: diff --git a/examples/02.Digital/DigitalInputPullup/DigitalInputPullup.ino b/examples/02.Digital/DigitalInputPullup/DigitalInputPullup.ino index 0f0eea1..b81798d 100644 --- a/examples/02.Digital/DigitalInputPullup/DigitalInputPullup.ino +++ b/examples/02.Digital/DigitalInputPullup/DigitalInputPullup.ino @@ -17,7 +17,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/InputPullupSerial + https://docs.arduino.cc/built-in-examples/digital/InputPullupSerial/ */ void setup() { diff --git a/examples/02.Digital/StateChangeDetection/StateChangeDetection.ino b/examples/02.Digital/StateChangeDetection/StateChangeDetection.ino index 5205e17..37c23dd 100644 --- a/examples/02.Digital/StateChangeDetection/StateChangeDetection.ino +++ b/examples/02.Digital/StateChangeDetection/StateChangeDetection.ino @@ -21,7 +21,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/StateChangeDetection + https://docs.arduino.cc/built-in-examples/digital/StateChangeDetection/ */ // this constant won't change: diff --git a/examples/02.Digital/toneKeyboard/toneKeyboard.ino b/examples/02.Digital/toneKeyboard/toneKeyboard.ino index c8e73c6..1f1bf26 100644 --- a/examples/02.Digital/toneKeyboard/toneKeyboard.ino +++ b/examples/02.Digital/toneKeyboard/toneKeyboard.ino @@ -14,7 +14,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/toneKeyboard + https://docs.arduino.cc/built-in-examples/digital/toneKeyboard/ */ #include "pitches.h" diff --git a/examples/02.Digital/toneMelody/toneMelody.ino b/examples/02.Digital/toneMelody/toneMelody.ino index 22022dc..2e4614e 100644 --- a/examples/02.Digital/toneMelody/toneMelody.ino +++ b/examples/02.Digital/toneMelody/toneMelody.ino @@ -12,7 +12,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/toneMelody + https://docs.arduino.cc/built-in-examples/digital/toneMelody/ */ #include "pitches.h" diff --git a/examples/02.Digital/toneMultiple/toneMultiple.ino b/examples/02.Digital/toneMultiple/toneMultiple.ino index 8d97fa7..81e50d9 100644 --- a/examples/02.Digital/toneMultiple/toneMultiple.ino +++ b/examples/02.Digital/toneMultiple/toneMultiple.ino @@ -12,7 +12,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/toneMultiple + https://docs.arduino.cc/built-in-examples/digital/toneMultiple/ */ void setup() { diff --git a/examples/02.Digital/tonePitchFollower/tonePitchFollower.ino b/examples/02.Digital/tonePitchFollower/tonePitchFollower.ino index 592f671..260a172 100644 --- a/examples/02.Digital/tonePitchFollower/tonePitchFollower.ino +++ b/examples/02.Digital/tonePitchFollower/tonePitchFollower.ino @@ -14,7 +14,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/tonePitchFollower + https://docs.arduino.cc/built-in-examples/digital/tonePitchFollower/ */ void setup() { From a4cb293b724e61830fc3bd867a77d14565d0f1dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20S=C3=B6derby?= <35461661+karlsoderby@users.noreply.github.com> Date: Fri, 19 Jan 2024 14:49:37 +0100 Subject: [PATCH 44/59] analog --- examples/03.Analog/AnalogInOutSerial/AnalogInOutSerial.ino | 2 +- examples/03.Analog/AnalogInput/AnalogInput.ino | 2 +- examples/03.Analog/AnalogWriteMega/AnalogWriteMega.ino | 2 +- examples/03.Analog/Calibration/Calibration.ino | 2 +- examples/03.Analog/Fading/Fading.ino | 2 +- examples/03.Analog/Smoothing/Smoothing.ino | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/03.Analog/AnalogInOutSerial/AnalogInOutSerial.ino b/examples/03.Analog/AnalogInOutSerial/AnalogInOutSerial.ino index 851342d..88aa312 100644 --- a/examples/03.Analog/AnalogInOutSerial/AnalogInOutSerial.ino +++ b/examples/03.Analog/AnalogInOutSerial/AnalogInOutSerial.ino @@ -17,7 +17,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/AnalogInOutSerial + https://docs.arduino.cc/built-in-examples/analog/AnalogInOutSerial/ */ // These constants won't change. They're used to give names to the pins used: diff --git a/examples/03.Analog/AnalogInput/AnalogInput.ino b/examples/03.Analog/AnalogInput/AnalogInput.ino index 923079c..e5e448c 100644 --- a/examples/03.Analog/AnalogInput/AnalogInput.ino +++ b/examples/03.Analog/AnalogInput/AnalogInput.ino @@ -24,7 +24,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/AnalogInput + https://docs.arduino.cc/built-in-examples/analog/AnalogInput/ */ int sensorPin = A0; // select the input pin for the potentiometer diff --git a/examples/03.Analog/AnalogWriteMega/AnalogWriteMega.ino b/examples/03.Analog/AnalogWriteMega/AnalogWriteMega.ino index 9d938d2..da14f13 100644 --- a/examples/03.Analog/AnalogWriteMega/AnalogWriteMega.ino +++ b/examples/03.Analog/AnalogWriteMega/AnalogWriteMega.ino @@ -12,7 +12,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/AnalogWriteMega + https://docs.arduino.cc/built-in-examples/analog/AnalogWriteMega/ */ // These constants won't change. They're used to give names to the pins used: diff --git a/examples/03.Analog/Calibration/Calibration.ino b/examples/03.Analog/Calibration/Calibration.ino index e0f639b..17cc790 100644 --- a/examples/03.Analog/Calibration/Calibration.ino +++ b/examples/03.Analog/Calibration/Calibration.ino @@ -23,7 +23,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/Calibration + https://docs.arduino.cc/built-in-examples/analog/Calibration/ */ // These constants won't change: diff --git a/examples/03.Analog/Fading/Fading.ino b/examples/03.Analog/Fading/Fading.ino index 7923546..b7f42f1 100644 --- a/examples/03.Analog/Fading/Fading.ino +++ b/examples/03.Analog/Fading/Fading.ino @@ -13,7 +13,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/Fading + https://docs.arduino.cc/built-in-examples/analog/Fading/ */ int ledPin = 9; // LED connected to digital pin 9 diff --git a/examples/03.Analog/Smoothing/Smoothing.ino b/examples/03.Analog/Smoothing/Smoothing.ino index 15c0f1a..2b26d56 100644 --- a/examples/03.Analog/Smoothing/Smoothing.ino +++ b/examples/03.Analog/Smoothing/Smoothing.ino @@ -15,7 +15,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/Smoothing + https://docs.arduino.cc/built-in-examples/analog/Smoothing/ */ // Define the number of samples to keep track of. The higher the number, the From 13bb330c4432ea0bcde160b65e0fd74803f34f4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20S=C3=B6derby?= <35461661+karlsoderby@users.noreply.github.com> Date: Fri, 19 Jan 2024 14:51:13 +0100 Subject: [PATCH 45/59] communication --- examples/04.Communication/ASCIITable/ASCIITable.ino | 2 +- examples/04.Communication/Dimmer/Dimmer.ino | 2 +- examples/04.Communication/Graph/Graph.ino | 2 +- examples/04.Communication/Midi/Midi.ino | 2 +- examples/04.Communication/MultiSerial/MultiSerial.ino | 2 +- examples/04.Communication/PhysicalPixel/PhysicalPixel.ino | 2 +- examples/04.Communication/ReadASCIIString/ReadASCIIString.ino | 2 +- .../04.Communication/SerialCallResponse/SerialCallResponse.ino | 2 +- .../SerialCallResponseASCII/SerialCallResponseASCII.ino | 2 +- examples/04.Communication/SerialEvent/SerialEvent.ino | 2 +- .../04.Communication/SerialPassthrough/SerialPassthrough.ino | 2 +- .../04.Communication/VirtualColorMixer/VirtualColorMixer.ino | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/04.Communication/ASCIITable/ASCIITable.ino b/examples/04.Communication/ASCIITable/ASCIITable.ino index f7fc4d4..5f7a272 100644 --- a/examples/04.Communication/ASCIITable/ASCIITable.ino +++ b/examples/04.Communication/ASCIITable/ASCIITable.ino @@ -16,7 +16,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/ASCIITable + https://docs.arduino.cc/built-in-examples/communication/ASCIITable */ void setup() { diff --git a/examples/04.Communication/Dimmer/Dimmer.ino b/examples/04.Communication/Dimmer/Dimmer.ino index 2f82344..05c93a3 100644 --- a/examples/04.Communication/Dimmer/Dimmer.ino +++ b/examples/04.Communication/Dimmer/Dimmer.ino @@ -17,7 +17,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/Dimmer + https://docs.arduino.cc/built-in-examples/communication/Dimmer */ const int ledPin = 9; // the pin that the LED is attached to diff --git a/examples/04.Communication/Graph/Graph.ino b/examples/04.Communication/Graph/Graph.ino index b50ca37..7caa0c3 100644 --- a/examples/04.Communication/Graph/Graph.ino +++ b/examples/04.Communication/Graph/Graph.ino @@ -22,7 +22,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/Graph + https://docs.arduino.cc/built-in-examples/communication/Graph */ void setup() { diff --git a/examples/04.Communication/Midi/Midi.ino b/examples/04.Communication/Midi/Midi.ino index 0602bf0..16f7d95 100644 --- a/examples/04.Communication/Midi/Midi.ino +++ b/examples/04.Communication/Midi/Midi.ino @@ -17,7 +17,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/Midi + https://docs.arduino.cc/built-in-examples/communication/Midi */ void setup() { diff --git a/examples/04.Communication/MultiSerial/MultiSerial.ino b/examples/04.Communication/MultiSerial/MultiSerial.ino index 20fc441..8e33576 100644 --- a/examples/04.Communication/MultiSerial/MultiSerial.ino +++ b/examples/04.Communication/MultiSerial/MultiSerial.ino @@ -18,7 +18,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/MultiSerialMega + https://docs.arduino.cc/built-in-examples/communication/MultiSerialMega */ diff --git a/examples/04.Communication/PhysicalPixel/PhysicalPixel.ino b/examples/04.Communication/PhysicalPixel/PhysicalPixel.ino index cff02ef..3dd314d 100644 --- a/examples/04.Communication/PhysicalPixel/PhysicalPixel.ino +++ b/examples/04.Communication/PhysicalPixel/PhysicalPixel.ino @@ -18,7 +18,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/PhysicalPixel + https://docs.arduino.cc/built-in-examples/communication/PhysicalPixel */ const int ledPin = 13; // the pin that the LED is attached to diff --git a/examples/04.Communication/ReadASCIIString/ReadASCIIString.ino b/examples/04.Communication/ReadASCIIString/ReadASCIIString.ino index 1cab997..3bfa619 100644 --- a/examples/04.Communication/ReadASCIIString/ReadASCIIString.ino +++ b/examples/04.Communication/ReadASCIIString/ReadASCIIString.ino @@ -18,7 +18,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/ReadASCIIString + https://docs.arduino.cc/built-in-examples/communication/ReadASCIIString */ // pins for the LEDs: diff --git a/examples/04.Communication/SerialCallResponse/SerialCallResponse.ino b/examples/04.Communication/SerialCallResponse/SerialCallResponse.ino index b778774..d2274ff 100644 --- a/examples/04.Communication/SerialCallResponse/SerialCallResponse.ino +++ b/examples/04.Communication/SerialCallResponse/SerialCallResponse.ino @@ -18,7 +18,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/SerialCallResponse + https://docs.arduino.cc/built-in-examples/communication/SerialCallResponse */ int firstSensor = 0; // first analog sensor diff --git a/examples/04.Communication/SerialCallResponseASCII/SerialCallResponseASCII.ino b/examples/04.Communication/SerialCallResponseASCII/SerialCallResponseASCII.ino index e5b02cd..881465d 100644 --- a/examples/04.Communication/SerialCallResponseASCII/SerialCallResponseASCII.ino +++ b/examples/04.Communication/SerialCallResponseASCII/SerialCallResponseASCII.ino @@ -19,7 +19,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/SerialCallResponseASCII + https://docs.arduino.cc/built-in-examples/communication/SerialCallResponseASCII */ int firstSensor = 0; // first analog sensor diff --git a/examples/04.Communication/SerialEvent/SerialEvent.ino b/examples/04.Communication/SerialEvent/SerialEvent.ino index 13c5630..655e564 100644 --- a/examples/04.Communication/SerialEvent/SerialEvent.ino +++ b/examples/04.Communication/SerialEvent/SerialEvent.ino @@ -15,7 +15,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/SerialEvent + https://docs.arduino.cc/built-in-examples/communication/SerialEvent */ String inputString = ""; // a String to hold incoming data diff --git a/examples/04.Communication/SerialPassthrough/SerialPassthrough.ino b/examples/04.Communication/SerialPassthrough/SerialPassthrough.ino index 8f46bbe..f8c15b4 100644 --- a/examples/04.Communication/SerialPassthrough/SerialPassthrough.ino +++ b/examples/04.Communication/SerialPassthrough/SerialPassthrough.ino @@ -21,7 +21,7 @@ created 23 May 2016 by Erik Nyquist - https://www.arduino.cc/en/Tutorial/BuiltInExamples/SerialPassthrough + https://docs.arduino.cc/built-in-examples/communication/SerialPassthrough */ void setup() { diff --git a/examples/04.Communication/VirtualColorMixer/VirtualColorMixer.ino b/examples/04.Communication/VirtualColorMixer/VirtualColorMixer.ino index 6ffd934..cb24719 100644 --- a/examples/04.Communication/VirtualColorMixer/VirtualColorMixer.ino +++ b/examples/04.Communication/VirtualColorMixer/VirtualColorMixer.ino @@ -13,7 +13,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/VirtualColorMixer + https://docs.arduino.cc/built-in-examples/communication/VirtualColorMixer */ const int redPin = A0; // sensor to control red color From 19902680d0bf275ce3eefde1d3835827b2e71bc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20S=C3=B6derby?= <35461661+karlsoderby@users.noreply.github.com> Date: Fri, 19 Jan 2024 14:53:29 +0100 Subject: [PATCH 46/59] control struct + sensors --- .DS_Store | Bin 0 -> 6148 bytes examples/05.Control/Arrays/Arrays.ino | 2 +- .../ForLoopIteration/ForLoopIteration.ino | 2 +- .../IfStatementConditional.ino | 2 +- .../WhileStatementConditional.ino | 2 +- examples/05.Control/switchCase/switchCase.ino | 2 +- examples/05.Control/switchCase2/switchCase2.ino | 2 +- examples/06.Sensors/ADXL3xx/ADXL3xx.ino | 2 +- examples/06.Sensors/Knock/Knock.ino | 2 +- examples/06.Sensors/Memsic2125/Memsic2125.ino | 2 +- examples/06.Sensors/Ping/Ping.ino | 2 +- 11 files changed, 10 insertions(+), 10 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..94e8e06d0b3c0eea52a799b60b44125cd5fb1383 GIT binary patch literal 6148 zcmeHKJ8Hu~5S?*U2;8_#xmWNF7NeX%7qG!0jV*_Sgp{gst{ly8K7<&_jUkPB12b=T zcHRoTLZcB8-F)oVA}bMT;fC^UVQO}6KCwk+6bQ#1uX2!QdH?L+hDr5&!niFsU$T?q zU;g1Vyu`ipL}sY~6`%rCfC^B7n-s9#3u~8wj8uRMP=Q|s?E6sQhBa{v^iKzZj{v|1 zX*aBWmH-w@0BhnHhzv}F3Jj{|h@nA8zGPiZ90P+cn!|_YlQkz4^{3kdX>d zflCD*V!N{b{{+7>|6h{0qXJamt`yLw>$?qJDSPYW<*e5h_!e$8KX5awor2))80hU7 g8*9gpUKDl3);O<;W1!QKcRG+i1Evd&3jDVMXN%qytN;K2 literal 0 HcmV?d00001 diff --git a/examples/05.Control/Arrays/Arrays.ino b/examples/05.Control/Arrays/Arrays.ino index 75d59ee..590f04d 100644 --- a/examples/05.Control/Arrays/Arrays.ino +++ b/examples/05.Control/Arrays/Arrays.ino @@ -17,7 +17,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/Arrays + https://docs.arduino.cc/built-in-examples/control-structures/Arrays */ int timer = 100; // The higher the number, the slower the timing. diff --git a/examples/05.Control/ForLoopIteration/ForLoopIteration.ino b/examples/05.Control/ForLoopIteration/ForLoopIteration.ino index e6b40e7..cc25522 100644 --- a/examples/05.Control/ForLoopIteration/ForLoopIteration.ino +++ b/examples/05.Control/ForLoopIteration/ForLoopIteration.ino @@ -14,7 +14,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/ForLoopIteration + https://docs.arduino.cc/built-in-examples/control-structures/ForLoopIteration */ int timer = 100; // The higher the number, the slower the timing. diff --git a/examples/05.Control/IfStatementConditional/IfStatementConditional.ino b/examples/05.Control/IfStatementConditional/IfStatementConditional.ino index ac6041a..3911f6a 100644 --- a/examples/05.Control/IfStatementConditional/IfStatementConditional.ino +++ b/examples/05.Control/IfStatementConditional/IfStatementConditional.ino @@ -21,7 +21,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/ifStatementConditional + https://docs.arduino.cc/built-in-examples/control-structures/ifStatementConditional */ // These constants won't change: diff --git a/examples/05.Control/WhileStatementConditional/WhileStatementConditional.ino b/examples/05.Control/WhileStatementConditional/WhileStatementConditional.ino index 0a36341..99e34c5 100644 --- a/examples/05.Control/WhileStatementConditional/WhileStatementConditional.ino +++ b/examples/05.Control/WhileStatementConditional/WhileStatementConditional.ino @@ -24,7 +24,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/WhileStatementConditional + https://docs.arduino.cc/built-in-examples/control-structures/WhileStatementConditional */ diff --git a/examples/05.Control/switchCase/switchCase.ino b/examples/05.Control/switchCase/switchCase.ino index f964b61..cf07666 100644 --- a/examples/05.Control/switchCase/switchCase.ino +++ b/examples/05.Control/switchCase/switchCase.ino @@ -18,7 +18,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/SwitchCase + https://docs.arduino.cc/built-in-examples/control-structures/SwitchCase */ // these constants won't change. They are the lowest and highest readings you diff --git a/examples/05.Control/switchCase2/switchCase2.ino b/examples/05.Control/switchCase2/switchCase2.ino index 48cbaa4..ab6c76c 100644 --- a/examples/05.Control/switchCase2/switchCase2.ino +++ b/examples/05.Control/switchCase2/switchCase2.ino @@ -17,7 +17,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/SwitchCase2 + https://docs.arduino.cc/built-in-examples/control-structures/SwitchCase2 */ void setup() { diff --git a/examples/06.Sensors/ADXL3xx/ADXL3xx.ino b/examples/06.Sensors/ADXL3xx/ADXL3xx.ino index b9dbf64..dec9dc4 100644 --- a/examples/06.Sensors/ADXL3xx/ADXL3xx.ino +++ b/examples/06.Sensors/ADXL3xx/ADXL3xx.ino @@ -21,7 +21,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/ADXL3xx + https://docs.arduino.cc/built-in-examples/sensors/ADXL3xx */ // these constants describe the pins. They won't change: diff --git a/examples/06.Sensors/Knock/Knock.ino b/examples/06.Sensors/Knock/Knock.ino index 0e21486..1259192 100644 --- a/examples/06.Sensors/Knock/Knock.ino +++ b/examples/06.Sensors/Knock/Knock.ino @@ -18,7 +18,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/Knock + https://docs.arduino.cc/built-in-examples/sensors/Knock */ diff --git a/examples/06.Sensors/Memsic2125/Memsic2125.ino b/examples/06.Sensors/Memsic2125/Memsic2125.ino index 006306b..75eb898 100644 --- a/examples/06.Sensors/Memsic2125/Memsic2125.ino +++ b/examples/06.Sensors/Memsic2125/Memsic2125.ino @@ -18,7 +18,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/Memsic2125 + https://docs.arduino.cc/built-in-examples/sensors/Memsic2125 */ // these constants won't change: diff --git a/examples/06.Sensors/Ping/Ping.ino b/examples/06.Sensors/Ping/Ping.ino index 2d9a0da..e6439b3 100644 --- a/examples/06.Sensors/Ping/Ping.ino +++ b/examples/06.Sensors/Ping/Ping.ino @@ -18,7 +18,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/Ping + https://docs.arduino.cc/built-in-examples/sensors/Ping */ // this constant won't change. It's the pin number of the sensor's output: From 6107c3d933e3c9da603a3fc1ffa7f89f285348df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20S=C3=B6derby?= <35461661+karlsoderby@users.noreply.github.com> Date: Fri, 19 Jan 2024 14:54:36 +0100 Subject: [PATCH 47/59] display + string --- examples/07.Display/RowColumnScanning/RowColumnScanning.ino | 2 +- examples/07.Display/barGraph/barGraph.ino | 2 +- examples/08.Strings/CharacterAnalysis/CharacterAnalysis.ino | 2 +- .../StringAdditionOperator/StringAdditionOperator.ino | 2 +- .../08.Strings/StringAppendOperator/StringAppendOperator.ino | 2 +- examples/08.Strings/StringCaseChanges/StringCaseChanges.ino | 2 +- examples/08.Strings/StringCharacters/StringCharacters.ino | 2 +- .../StringComparisonOperators/StringComparisonOperators.ino | 2 +- examples/08.Strings/StringConstructors/StringConstructors.ino | 2 +- examples/08.Strings/StringIndexOf/StringIndexOf.ino | 2 +- examples/08.Strings/StringLength/StringLength.ino | 2 +- examples/08.Strings/StringLengthTrim/StringLengthTrim.ino | 2 +- examples/08.Strings/StringReplace/StringReplace.ino | 2 +- .../StringStartsWithEndsWith/StringStartsWithEndsWith.ino | 2 +- examples/08.Strings/StringSubstring/StringSubstring.ino | 2 +- examples/08.Strings/StringToInt/StringToInt.ino | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/examples/07.Display/RowColumnScanning/RowColumnScanning.ino b/examples/07.Display/RowColumnScanning/RowColumnScanning.ino index 0fb04c5..4944fd8 100644 --- a/examples/07.Display/RowColumnScanning/RowColumnScanning.ino +++ b/examples/07.Display/RowColumnScanning/RowColumnScanning.ino @@ -28,7 +28,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/RowColumnScanning + https://docs.arduino.cc/built-in-examples/display/RowColumnScanning */ // 2-dimensional array of row pin numbers: diff --git a/examples/07.Display/barGraph/barGraph.ino b/examples/07.Display/barGraph/barGraph.ino index b15f840..9f539e3 100644 --- a/examples/07.Display/barGraph/barGraph.ino +++ b/examples/07.Display/barGraph/barGraph.ino @@ -17,7 +17,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/BarGraph + https://docs.arduino.cc/built-in-examples/display/BarGraph */ // these constants won't change: diff --git a/examples/08.Strings/CharacterAnalysis/CharacterAnalysis.ino b/examples/08.Strings/CharacterAnalysis/CharacterAnalysis.ino index 40d68a5..2fa9cb9 100644 --- a/examples/08.Strings/CharacterAnalysis/CharacterAnalysis.ino +++ b/examples/08.Strings/CharacterAnalysis/CharacterAnalysis.ino @@ -10,7 +10,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/CharacterAnalysis + https://docs.arduino.cc/built-in-examples/strings/CharacterAnalysis */ void setup() { diff --git a/examples/08.Strings/StringAdditionOperator/StringAdditionOperator.ino b/examples/08.Strings/StringAdditionOperator/StringAdditionOperator.ino index 4763acf..3a219f0 100644 --- a/examples/08.Strings/StringAdditionOperator/StringAdditionOperator.ino +++ b/examples/08.Strings/StringAdditionOperator/StringAdditionOperator.ino @@ -10,7 +10,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringAdditionOperator + https://docs.arduino.cc/built-in-examples/strings/StringAdditionOperator */ // declare three Strings: diff --git a/examples/08.Strings/StringAppendOperator/StringAppendOperator.ino b/examples/08.Strings/StringAppendOperator/StringAppendOperator.ino index 4846cf4..60f1e59 100644 --- a/examples/08.Strings/StringAppendOperator/StringAppendOperator.ino +++ b/examples/08.Strings/StringAppendOperator/StringAppendOperator.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringAppendOperator + https://docs.arduino.cc/built-in-examples/strings/StringAppendOperator */ String stringOne, stringTwo; diff --git a/examples/08.Strings/StringCaseChanges/StringCaseChanges.ino b/examples/08.Strings/StringCaseChanges/StringCaseChanges.ino index 52d4de8..ae0744f 100644 --- a/examples/08.Strings/StringCaseChanges/StringCaseChanges.ino +++ b/examples/08.Strings/StringCaseChanges/StringCaseChanges.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringCaseChanges + https://docs.arduino.cc/built-in-examples/strings/StringCaseChanges */ void setup() { diff --git a/examples/08.Strings/StringCharacters/StringCharacters.ino b/examples/08.Strings/StringCharacters/StringCharacters.ino index 6c64b57..1079819 100644 --- a/examples/08.Strings/StringCharacters/StringCharacters.ino +++ b/examples/08.Strings/StringCharacters/StringCharacters.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringCharacters + https://docs.arduino.cc/built-in-examples/strings/StringCharacters */ void setup() { diff --git a/examples/08.Strings/StringComparisonOperators/StringComparisonOperators.ino b/examples/08.Strings/StringComparisonOperators/StringComparisonOperators.ino index 4e57469..332cc8f 100644 --- a/examples/08.Strings/StringComparisonOperators/StringComparisonOperators.ino +++ b/examples/08.Strings/StringComparisonOperators/StringComparisonOperators.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringComparisonOperators + https://docs.arduino.cc/built-in-examples/strings/StringComparisonOperators */ String stringOne, stringTwo; diff --git a/examples/08.Strings/StringConstructors/StringConstructors.ino b/examples/08.Strings/StringConstructors/StringConstructors.ino index 36ff78a..504130c 100644 --- a/examples/08.Strings/StringConstructors/StringConstructors.ino +++ b/examples/08.Strings/StringConstructors/StringConstructors.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringConstructors + https://docs.arduino.cc/built-in-examples/strings/StringConstructors */ void setup() { diff --git a/examples/08.Strings/StringIndexOf/StringIndexOf.ino b/examples/08.Strings/StringIndexOf/StringIndexOf.ino index cf1f816..89d5f8d 100644 --- a/examples/08.Strings/StringIndexOf/StringIndexOf.ino +++ b/examples/08.Strings/StringIndexOf/StringIndexOf.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringIndexOf + https://docs.arduino.cc/built-in-examples/strings/StringIndexOf */ void setup() { diff --git a/examples/08.Strings/StringLength/StringLength.ino b/examples/08.Strings/StringLength/StringLength.ino index c9378a7..0f9e421 100644 --- a/examples/08.Strings/StringLength/StringLength.ino +++ b/examples/08.Strings/StringLength/StringLength.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringLengthTrim + https://docs.arduino.cc/built-in-examples/strings/StringLengthTrim */ String txtMsg = ""; // a string for incoming text diff --git a/examples/08.Strings/StringLengthTrim/StringLengthTrim.ino b/examples/08.Strings/StringLengthTrim/StringLengthTrim.ino index bdef83a..a1c2a7e 100644 --- a/examples/08.Strings/StringLengthTrim/StringLengthTrim.ino +++ b/examples/08.Strings/StringLengthTrim/StringLengthTrim.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringLengthTrim + https://docs.arduino.cc/built-in-examples/strings/StringLengthTrim */ void setup() { diff --git a/examples/08.Strings/StringReplace/StringReplace.ino b/examples/08.Strings/StringReplace/StringReplace.ino index 6fa9ba1..49de7d2 100644 --- a/examples/08.Strings/StringReplace/StringReplace.ino +++ b/examples/08.Strings/StringReplace/StringReplace.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringReplace + https://docs.arduino.cc/built-in-examples/strings/StringReplace */ void setup() { diff --git a/examples/08.Strings/StringStartsWithEndsWith/StringStartsWithEndsWith.ino b/examples/08.Strings/StringStartsWithEndsWith/StringStartsWithEndsWith.ino index 9cdbe24..186ea3f 100644 --- a/examples/08.Strings/StringStartsWithEndsWith/StringStartsWithEndsWith.ino +++ b/examples/08.Strings/StringStartsWithEndsWith/StringStartsWithEndsWith.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringStartsWithEndsWith + https://docs.arduino.cc/built-in-examples/strings/StringStartsWithEndsWith */ void setup() { diff --git a/examples/08.Strings/StringSubstring/StringSubstring.ino b/examples/08.Strings/StringSubstring/StringSubstring.ino index 871da29..dac9ae9 100644 --- a/examples/08.Strings/StringSubstring/StringSubstring.ino +++ b/examples/08.Strings/StringSubstring/StringSubstring.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringSubstring + https://docs.arduino.cc/built-in-examples/strings/StringSubstring */ void setup() { diff --git a/examples/08.Strings/StringToInt/StringToInt.ino b/examples/08.Strings/StringToInt/StringToInt.ino index dc10d02..96ab920 100644 --- a/examples/08.Strings/StringToInt/StringToInt.ino +++ b/examples/08.Strings/StringToInt/StringToInt.ino @@ -12,7 +12,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/StringToInt + https://docs.arduino.cc/built-in-examples/strings/StringToInt */ String inString = ""; // string to hold input From 67204e023146e3fdd66d89b5722bf2e3780eb26e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20S=C3=B6derby?= <35461661+karlsoderby@users.noreply.github.com> Date: Fri, 19 Jan 2024 14:55:59 +0100 Subject: [PATCH 48/59] usb --- examples/09.USB/Keyboard/KeyboardLogout/KeyboardLogout.ino | 2 +- examples/09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino | 2 +- .../09.USB/Keyboard/KeyboardReprogram/KeyboardReprogram.ino | 2 +- examples/09.USB/Keyboard/KeyboardSerial/KeyboardSerial.ino | 2 +- .../09.USB/KeyboardAndMouseControl/KeyboardAndMouseControl.ino | 2 +- examples/09.USB/Mouse/ButtonMouseControl/ButtonMouseControl.ino | 2 +- .../09.USB/Mouse/JoystickMouseControl/JoystickMouseControl.ino | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/09.USB/Keyboard/KeyboardLogout/KeyboardLogout.ino b/examples/09.USB/Keyboard/KeyboardLogout/KeyboardLogout.ino index c44c509..6bab638 100644 --- a/examples/09.USB/Keyboard/KeyboardLogout/KeyboardLogout.ino +++ b/examples/09.USB/Keyboard/KeyboardLogout/KeyboardLogout.ino @@ -22,7 +22,7 @@ This example is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/KeyboardLogout + https://docs.arduino.cc/built-in-examples/usb/KeyboardLogout */ #define OSX 0 diff --git a/examples/09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino b/examples/09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino index fbf4adb..45df865 100644 --- a/examples/09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino +++ b/examples/09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino @@ -17,7 +17,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/KeyboardMessage + https://docs.arduino.cc/built-in-examples/usb/KeyboardMessage */ #include "Keyboard.h" diff --git a/examples/09.USB/Keyboard/KeyboardReprogram/KeyboardReprogram.ino b/examples/09.USB/Keyboard/KeyboardReprogram/KeyboardReprogram.ino index 94efe8c..6e1a872 100644 --- a/examples/09.USB/Keyboard/KeyboardReprogram/KeyboardReprogram.ino +++ b/examples/09.USB/Keyboard/KeyboardReprogram/KeyboardReprogram.ino @@ -22,7 +22,7 @@ This example is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/KeyboardReprogram + https://docs.arduino.cc/built-in-examples/usb/KeyboardReprogram */ #include "Keyboard.h" diff --git a/examples/09.USB/Keyboard/KeyboardSerial/KeyboardSerial.ino b/examples/09.USB/Keyboard/KeyboardSerial/KeyboardSerial.ino index 050bb18..411adfb 100644 --- a/examples/09.USB/Keyboard/KeyboardSerial/KeyboardSerial.ino +++ b/examples/09.USB/Keyboard/KeyboardSerial/KeyboardSerial.ino @@ -16,7 +16,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/KeyboardSerial + https://docs.arduino.cc/built-in-examples/usb/KeyboardSerial */ #include "Keyboard.h" diff --git a/examples/09.USB/KeyboardAndMouseControl/KeyboardAndMouseControl.ino b/examples/09.USB/KeyboardAndMouseControl/KeyboardAndMouseControl.ino index 3b1a280..ea2c439 100644 --- a/examples/09.USB/KeyboardAndMouseControl/KeyboardAndMouseControl.ino +++ b/examples/09.USB/KeyboardAndMouseControl/KeyboardAndMouseControl.ino @@ -18,7 +18,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/KeyboardAndMouseControl + https://docs.arduino.cc/built-in-examples/usb/KeyboardAndMouseControl */ #include "Keyboard.h" diff --git a/examples/09.USB/Mouse/ButtonMouseControl/ButtonMouseControl.ino b/examples/09.USB/Mouse/ButtonMouseControl/ButtonMouseControl.ino index c27ef70..7547c55 100644 --- a/examples/09.USB/Mouse/ButtonMouseControl/ButtonMouseControl.ino +++ b/examples/09.USB/Mouse/ButtonMouseControl/ButtonMouseControl.ino @@ -20,7 +20,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/ButtonMouseControl + https://docs.arduino.cc/built-in-examples/usb/ButtonMouseControl */ #include "Mouse.h" diff --git a/examples/09.USB/Mouse/JoystickMouseControl/JoystickMouseControl.ino b/examples/09.USB/Mouse/JoystickMouseControl/JoystickMouseControl.ino index 266ba61..eba0bc1 100644 --- a/examples/09.USB/Mouse/JoystickMouseControl/JoystickMouseControl.ino +++ b/examples/09.USB/Mouse/JoystickMouseControl/JoystickMouseControl.ino @@ -26,7 +26,7 @@ This example code is in the public domain. - https://www.arduino.cc/en/Tutorial/BuiltInExamples/JoystickMouseControl + https://docs.arduino.cc/built-in-examples/usb/JoystickMouseControl */ #include "Mouse.h" From da8f67242c1233117787d4d6e95ad3d50685cbbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20S=C3=B6derby?= <35461661+karlsoderby@users.noreply.github.com> Date: Tue, 23 Jan 2024 10:47:38 +0100 Subject: [PATCH 49/59] Apply suggestions from code review Co-authored-by: per1234 --- examples/04.Communication/ASCIITable/ASCIITable.ino | 2 +- examples/04.Communication/Dimmer/Dimmer.ino | 2 +- examples/04.Communication/Graph/Graph.ino | 2 +- examples/04.Communication/Midi/Midi.ino | 2 +- examples/04.Communication/MultiSerial/MultiSerial.ino | 2 +- examples/04.Communication/PhysicalPixel/PhysicalPixel.ino | 2 +- examples/04.Communication/ReadASCIIString/ReadASCIIString.ino | 2 +- .../04.Communication/SerialCallResponse/SerialCallResponse.ino | 2 +- .../SerialCallResponseASCII/SerialCallResponseASCII.ino | 2 +- examples/04.Communication/SerialEvent/SerialEvent.ino | 2 +- .../04.Communication/SerialPassthrough/SerialPassthrough.ino | 2 +- .../04.Communication/VirtualColorMixer/VirtualColorMixer.ino | 2 +- examples/05.Control/Arrays/Arrays.ino | 2 +- examples/05.Control/ForLoopIteration/ForLoopIteration.ino | 2 +- .../IfStatementConditional/IfStatementConditional.ino | 2 +- .../WhileStatementConditional/WhileStatementConditional.ino | 2 +- examples/05.Control/switchCase/switchCase.ino | 2 +- examples/05.Control/switchCase2/switchCase2.ino | 2 +- examples/06.Sensors/ADXL3xx/ADXL3xx.ino | 2 +- examples/06.Sensors/Knock/Knock.ino | 2 +- examples/06.Sensors/Memsic2125/Memsic2125.ino | 2 +- examples/06.Sensors/Ping/Ping.ino | 2 +- examples/07.Display/RowColumnScanning/RowColumnScanning.ino | 2 +- examples/07.Display/barGraph/barGraph.ino | 2 +- examples/08.Strings/CharacterAnalysis/CharacterAnalysis.ino | 2 +- .../StringAdditionOperator/StringAdditionOperator.ino | 2 +- .../08.Strings/StringAppendOperator/StringAppendOperator.ino | 2 +- examples/08.Strings/StringCaseChanges/StringCaseChanges.ino | 2 +- examples/08.Strings/StringCharacters/StringCharacters.ino | 2 +- .../StringComparisonOperators/StringComparisonOperators.ino | 2 +- examples/08.Strings/StringConstructors/StringConstructors.ino | 2 +- examples/08.Strings/StringIndexOf/StringIndexOf.ino | 2 +- examples/08.Strings/StringLength/StringLength.ino | 2 +- examples/08.Strings/StringLengthTrim/StringLengthTrim.ino | 2 +- examples/08.Strings/StringReplace/StringReplace.ino | 2 +- .../StringStartsWithEndsWith/StringStartsWithEndsWith.ino | 2 +- examples/08.Strings/StringSubstring/StringSubstring.ino | 2 +- examples/08.Strings/StringToInt/StringToInt.ino | 2 +- examples/09.USB/Keyboard/KeyboardLogout/KeyboardLogout.ino | 2 +- examples/09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino | 2 +- .../09.USB/Keyboard/KeyboardReprogram/KeyboardReprogram.ino | 2 +- examples/09.USB/Keyboard/KeyboardSerial/KeyboardSerial.ino | 2 +- .../09.USB/KeyboardAndMouseControl/KeyboardAndMouseControl.ino | 2 +- examples/09.USB/Mouse/ButtonMouseControl/ButtonMouseControl.ino | 2 +- .../09.USB/Mouse/JoystickMouseControl/JoystickMouseControl.ino | 2 +- 45 files changed, 45 insertions(+), 45 deletions(-) diff --git a/examples/04.Communication/ASCIITable/ASCIITable.ino b/examples/04.Communication/ASCIITable/ASCIITable.ino index 5f7a272..2f6e2fa 100644 --- a/examples/04.Communication/ASCIITable/ASCIITable.ino +++ b/examples/04.Communication/ASCIITable/ASCIITable.ino @@ -16,7 +16,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/communication/ASCIITable + https://docs.arduino.cc/built-in-examples/communication/ASCIITable/ */ void setup() { diff --git a/examples/04.Communication/Dimmer/Dimmer.ino b/examples/04.Communication/Dimmer/Dimmer.ino index 05c93a3..e6475c3 100644 --- a/examples/04.Communication/Dimmer/Dimmer.ino +++ b/examples/04.Communication/Dimmer/Dimmer.ino @@ -17,7 +17,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/communication/Dimmer + https://docs.arduino.cc/built-in-examples/communication/Dimmer/ */ const int ledPin = 9; // the pin that the LED is attached to diff --git a/examples/04.Communication/Graph/Graph.ino b/examples/04.Communication/Graph/Graph.ino index 7caa0c3..0fd33b2 100644 --- a/examples/04.Communication/Graph/Graph.ino +++ b/examples/04.Communication/Graph/Graph.ino @@ -22,7 +22,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/communication/Graph + https://docs.arduino.cc/built-in-examples/communication/Graph/ */ void setup() { diff --git a/examples/04.Communication/Midi/Midi.ino b/examples/04.Communication/Midi/Midi.ino index 16f7d95..901766d 100644 --- a/examples/04.Communication/Midi/Midi.ino +++ b/examples/04.Communication/Midi/Midi.ino @@ -17,7 +17,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/communication/Midi + https://docs.arduino.cc/built-in-examples/communication/Midi/ */ void setup() { diff --git a/examples/04.Communication/MultiSerial/MultiSerial.ino b/examples/04.Communication/MultiSerial/MultiSerial.ino index 8e33576..30f7dd0 100644 --- a/examples/04.Communication/MultiSerial/MultiSerial.ino +++ b/examples/04.Communication/MultiSerial/MultiSerial.ino @@ -18,7 +18,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/communication/MultiSerialMega + https://docs.arduino.cc/built-in-examples/communication/MultiSerialMega/ */ diff --git a/examples/04.Communication/PhysicalPixel/PhysicalPixel.ino b/examples/04.Communication/PhysicalPixel/PhysicalPixel.ino index 3dd314d..ff8866e 100644 --- a/examples/04.Communication/PhysicalPixel/PhysicalPixel.ino +++ b/examples/04.Communication/PhysicalPixel/PhysicalPixel.ino @@ -18,7 +18,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/communication/PhysicalPixel + https://docs.arduino.cc/built-in-examples/communication/PhysicalPixel/ */ const int ledPin = 13; // the pin that the LED is attached to diff --git a/examples/04.Communication/ReadASCIIString/ReadASCIIString.ino b/examples/04.Communication/ReadASCIIString/ReadASCIIString.ino index 3bfa619..4832d6b 100644 --- a/examples/04.Communication/ReadASCIIString/ReadASCIIString.ino +++ b/examples/04.Communication/ReadASCIIString/ReadASCIIString.ino @@ -18,7 +18,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/communication/ReadASCIIString + https://docs.arduino.cc/built-in-examples/communication/ReadASCIIString/ */ // pins for the LEDs: diff --git a/examples/04.Communication/SerialCallResponse/SerialCallResponse.ino b/examples/04.Communication/SerialCallResponse/SerialCallResponse.ino index d2274ff..9983cd4 100644 --- a/examples/04.Communication/SerialCallResponse/SerialCallResponse.ino +++ b/examples/04.Communication/SerialCallResponse/SerialCallResponse.ino @@ -18,7 +18,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/communication/SerialCallResponse + https://docs.arduino.cc/built-in-examples/communication/SerialCallResponse/ */ int firstSensor = 0; // first analog sensor diff --git a/examples/04.Communication/SerialCallResponseASCII/SerialCallResponseASCII.ino b/examples/04.Communication/SerialCallResponseASCII/SerialCallResponseASCII.ino index 881465d..ee044c6 100644 --- a/examples/04.Communication/SerialCallResponseASCII/SerialCallResponseASCII.ino +++ b/examples/04.Communication/SerialCallResponseASCII/SerialCallResponseASCII.ino @@ -19,7 +19,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/communication/SerialCallResponseASCII + https://docs.arduino.cc/built-in-examples/communication/SerialCallResponseASCII/ */ int firstSensor = 0; // first analog sensor diff --git a/examples/04.Communication/SerialEvent/SerialEvent.ino b/examples/04.Communication/SerialEvent/SerialEvent.ino index 655e564..2401a63 100644 --- a/examples/04.Communication/SerialEvent/SerialEvent.ino +++ b/examples/04.Communication/SerialEvent/SerialEvent.ino @@ -15,7 +15,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/communication/SerialEvent + https://docs.arduino.cc/built-in-examples/communication/SerialEvent/ */ String inputString = ""; // a String to hold incoming data diff --git a/examples/04.Communication/SerialPassthrough/SerialPassthrough.ino b/examples/04.Communication/SerialPassthrough/SerialPassthrough.ino index f8c15b4..96fc01a 100644 --- a/examples/04.Communication/SerialPassthrough/SerialPassthrough.ino +++ b/examples/04.Communication/SerialPassthrough/SerialPassthrough.ino @@ -21,7 +21,7 @@ created 23 May 2016 by Erik Nyquist - https://docs.arduino.cc/built-in-examples/communication/SerialPassthrough + https://docs.arduino.cc/built-in-examples/communication/SerialPassthrough/ */ void setup() { diff --git a/examples/04.Communication/VirtualColorMixer/VirtualColorMixer.ino b/examples/04.Communication/VirtualColorMixer/VirtualColorMixer.ino index cb24719..54ad16b 100644 --- a/examples/04.Communication/VirtualColorMixer/VirtualColorMixer.ino +++ b/examples/04.Communication/VirtualColorMixer/VirtualColorMixer.ino @@ -13,7 +13,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/communication/VirtualColorMixer + https://docs.arduino.cc/built-in-examples/communication/VirtualColorMixer/ */ const int redPin = A0; // sensor to control red color diff --git a/examples/05.Control/Arrays/Arrays.ino b/examples/05.Control/Arrays/Arrays.ino index 590f04d..cefc940 100644 --- a/examples/05.Control/Arrays/Arrays.ino +++ b/examples/05.Control/Arrays/Arrays.ino @@ -17,7 +17,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/control-structures/Arrays + https://docs.arduino.cc/built-in-examples/control-structures/Arrays/ */ int timer = 100; // The higher the number, the slower the timing. diff --git a/examples/05.Control/ForLoopIteration/ForLoopIteration.ino b/examples/05.Control/ForLoopIteration/ForLoopIteration.ino index cc25522..8e3f3cd 100644 --- a/examples/05.Control/ForLoopIteration/ForLoopIteration.ino +++ b/examples/05.Control/ForLoopIteration/ForLoopIteration.ino @@ -14,7 +14,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/control-structures/ForLoopIteration + https://docs.arduino.cc/built-in-examples/control-structures/ForLoopIteration/ */ int timer = 100; // The higher the number, the slower the timing. diff --git a/examples/05.Control/IfStatementConditional/IfStatementConditional.ino b/examples/05.Control/IfStatementConditional/IfStatementConditional.ino index 3911f6a..d57caa7 100644 --- a/examples/05.Control/IfStatementConditional/IfStatementConditional.ino +++ b/examples/05.Control/IfStatementConditional/IfStatementConditional.ino @@ -21,7 +21,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/control-structures/ifStatementConditional + https://docs.arduino.cc/built-in-examples/control-structures/ifStatementConditional/ */ // These constants won't change: diff --git a/examples/05.Control/WhileStatementConditional/WhileStatementConditional.ino b/examples/05.Control/WhileStatementConditional/WhileStatementConditional.ino index 99e34c5..d7955d0 100644 --- a/examples/05.Control/WhileStatementConditional/WhileStatementConditional.ino +++ b/examples/05.Control/WhileStatementConditional/WhileStatementConditional.ino @@ -24,7 +24,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/control-structures/WhileStatementConditional + https://docs.arduino.cc/built-in-examples/control-structures/WhileStatementConditional/ */ diff --git a/examples/05.Control/switchCase/switchCase.ino b/examples/05.Control/switchCase/switchCase.ino index cf07666..c2b736b 100644 --- a/examples/05.Control/switchCase/switchCase.ino +++ b/examples/05.Control/switchCase/switchCase.ino @@ -18,7 +18,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/control-structures/SwitchCase + https://docs.arduino.cc/built-in-examples/control-structures/SwitchCase/ */ // these constants won't change. They are the lowest and highest readings you diff --git a/examples/05.Control/switchCase2/switchCase2.ino b/examples/05.Control/switchCase2/switchCase2.ino index ab6c76c..554f3ac 100644 --- a/examples/05.Control/switchCase2/switchCase2.ino +++ b/examples/05.Control/switchCase2/switchCase2.ino @@ -17,7 +17,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/control-structures/SwitchCase2 + https://docs.arduino.cc/built-in-examples/control-structures/SwitchCase2/ */ void setup() { diff --git a/examples/06.Sensors/ADXL3xx/ADXL3xx.ino b/examples/06.Sensors/ADXL3xx/ADXL3xx.ino index dec9dc4..30282d0 100644 --- a/examples/06.Sensors/ADXL3xx/ADXL3xx.ino +++ b/examples/06.Sensors/ADXL3xx/ADXL3xx.ino @@ -21,7 +21,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/sensors/ADXL3xx + https://docs.arduino.cc/built-in-examples/sensors/ADXL3xx/ */ // these constants describe the pins. They won't change: diff --git a/examples/06.Sensors/Knock/Knock.ino b/examples/06.Sensors/Knock/Knock.ino index 1259192..fa174a1 100644 --- a/examples/06.Sensors/Knock/Knock.ino +++ b/examples/06.Sensors/Knock/Knock.ino @@ -18,7 +18,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/sensors/Knock + https://docs.arduino.cc/built-in-examples/sensors/Knock/ */ diff --git a/examples/06.Sensors/Memsic2125/Memsic2125.ino b/examples/06.Sensors/Memsic2125/Memsic2125.ino index 75eb898..a6aea27 100644 --- a/examples/06.Sensors/Memsic2125/Memsic2125.ino +++ b/examples/06.Sensors/Memsic2125/Memsic2125.ino @@ -18,7 +18,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/sensors/Memsic2125 + https://docs.arduino.cc/built-in-examples/sensors/Memsic2125/ */ // these constants won't change: diff --git a/examples/06.Sensors/Ping/Ping.ino b/examples/06.Sensors/Ping/Ping.ino index e6439b3..a217ba2 100644 --- a/examples/06.Sensors/Ping/Ping.ino +++ b/examples/06.Sensors/Ping/Ping.ino @@ -18,7 +18,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/sensors/Ping + https://docs.arduino.cc/built-in-examples/sensors/Ping/ */ // this constant won't change. It's the pin number of the sensor's output: diff --git a/examples/07.Display/RowColumnScanning/RowColumnScanning.ino b/examples/07.Display/RowColumnScanning/RowColumnScanning.ino index 4944fd8..54a1224 100644 --- a/examples/07.Display/RowColumnScanning/RowColumnScanning.ino +++ b/examples/07.Display/RowColumnScanning/RowColumnScanning.ino @@ -28,7 +28,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/display/RowColumnScanning + https://docs.arduino.cc/built-in-examples/display/RowColumnScanning/ */ // 2-dimensional array of row pin numbers: diff --git a/examples/07.Display/barGraph/barGraph.ino b/examples/07.Display/barGraph/barGraph.ino index 9f539e3..cd5a16c 100644 --- a/examples/07.Display/barGraph/barGraph.ino +++ b/examples/07.Display/barGraph/barGraph.ino @@ -17,7 +17,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/display/BarGraph + https://docs.arduino.cc/built-in-examples/display/BarGraph/ */ // these constants won't change: diff --git a/examples/08.Strings/CharacterAnalysis/CharacterAnalysis.ino b/examples/08.Strings/CharacterAnalysis/CharacterAnalysis.ino index 2fa9cb9..9f338e6 100644 --- a/examples/08.Strings/CharacterAnalysis/CharacterAnalysis.ino +++ b/examples/08.Strings/CharacterAnalysis/CharacterAnalysis.ino @@ -10,7 +10,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/strings/CharacterAnalysis + https://docs.arduino.cc/built-in-examples/strings/CharacterAnalysis/ */ void setup() { diff --git a/examples/08.Strings/StringAdditionOperator/StringAdditionOperator.ino b/examples/08.Strings/StringAdditionOperator/StringAdditionOperator.ino index 3a219f0..d85aa44 100644 --- a/examples/08.Strings/StringAdditionOperator/StringAdditionOperator.ino +++ b/examples/08.Strings/StringAdditionOperator/StringAdditionOperator.ino @@ -10,7 +10,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/strings/StringAdditionOperator + https://docs.arduino.cc/built-in-examples/strings/StringAdditionOperator/ */ // declare three Strings: diff --git a/examples/08.Strings/StringAppendOperator/StringAppendOperator.ino b/examples/08.Strings/StringAppendOperator/StringAppendOperator.ino index 60f1e59..d7bc959 100644 --- a/examples/08.Strings/StringAppendOperator/StringAppendOperator.ino +++ b/examples/08.Strings/StringAppendOperator/StringAppendOperator.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/strings/StringAppendOperator + https://docs.arduino.cc/built-in-examples/strings/StringAppendOperator/ */ String stringOne, stringTwo; diff --git a/examples/08.Strings/StringCaseChanges/StringCaseChanges.ino b/examples/08.Strings/StringCaseChanges/StringCaseChanges.ino index ae0744f..0d983f2 100644 --- a/examples/08.Strings/StringCaseChanges/StringCaseChanges.ino +++ b/examples/08.Strings/StringCaseChanges/StringCaseChanges.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/strings/StringCaseChanges + https://docs.arduino.cc/built-in-examples/strings/StringCaseChanges/ */ void setup() { diff --git a/examples/08.Strings/StringCharacters/StringCharacters.ino b/examples/08.Strings/StringCharacters/StringCharacters.ino index 1079819..93f2a16 100644 --- a/examples/08.Strings/StringCharacters/StringCharacters.ino +++ b/examples/08.Strings/StringCharacters/StringCharacters.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/strings/StringCharacters + https://docs.arduino.cc/built-in-examples/strings/StringCharacters/ */ void setup() { diff --git a/examples/08.Strings/StringComparisonOperators/StringComparisonOperators.ino b/examples/08.Strings/StringComparisonOperators/StringComparisonOperators.ino index 332cc8f..f8c9d80 100644 --- a/examples/08.Strings/StringComparisonOperators/StringComparisonOperators.ino +++ b/examples/08.Strings/StringComparisonOperators/StringComparisonOperators.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/strings/StringComparisonOperators + https://docs.arduino.cc/built-in-examples/strings/StringComparisonOperators/ */ String stringOne, stringTwo; diff --git a/examples/08.Strings/StringConstructors/StringConstructors.ino b/examples/08.Strings/StringConstructors/StringConstructors.ino index 504130c..146674a 100644 --- a/examples/08.Strings/StringConstructors/StringConstructors.ino +++ b/examples/08.Strings/StringConstructors/StringConstructors.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/strings/StringConstructors + https://docs.arduino.cc/built-in-examples/strings/StringConstructors/ */ void setup() { diff --git a/examples/08.Strings/StringIndexOf/StringIndexOf.ino b/examples/08.Strings/StringIndexOf/StringIndexOf.ino index 89d5f8d..4741bdf 100644 --- a/examples/08.Strings/StringIndexOf/StringIndexOf.ino +++ b/examples/08.Strings/StringIndexOf/StringIndexOf.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/strings/StringIndexOf + https://docs.arduino.cc/built-in-examples/strings/StringIndexOf/ */ void setup() { diff --git a/examples/08.Strings/StringLength/StringLength.ino b/examples/08.Strings/StringLength/StringLength.ino index 0f9e421..7732aa9 100644 --- a/examples/08.Strings/StringLength/StringLength.ino +++ b/examples/08.Strings/StringLength/StringLength.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/strings/StringLengthTrim + https://docs.arduino.cc/built-in-examples/strings/StringLengthTrim/ */ String txtMsg = ""; // a string for incoming text diff --git a/examples/08.Strings/StringLengthTrim/StringLengthTrim.ino b/examples/08.Strings/StringLengthTrim/StringLengthTrim.ino index a1c2a7e..dbdf6b6 100644 --- a/examples/08.Strings/StringLengthTrim/StringLengthTrim.ino +++ b/examples/08.Strings/StringLengthTrim/StringLengthTrim.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/strings/StringLengthTrim + https://docs.arduino.cc/built-in-examples/strings/StringLengthTrim/ */ void setup() { diff --git a/examples/08.Strings/StringReplace/StringReplace.ino b/examples/08.Strings/StringReplace/StringReplace.ino index 49de7d2..72bbb5e 100644 --- a/examples/08.Strings/StringReplace/StringReplace.ino +++ b/examples/08.Strings/StringReplace/StringReplace.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/strings/StringReplace + https://docs.arduino.cc/built-in-examples/strings/StringReplace/ */ void setup() { diff --git a/examples/08.Strings/StringStartsWithEndsWith/StringStartsWithEndsWith.ino b/examples/08.Strings/StringStartsWithEndsWith/StringStartsWithEndsWith.ino index 186ea3f..ef31a68 100644 --- a/examples/08.Strings/StringStartsWithEndsWith/StringStartsWithEndsWith.ino +++ b/examples/08.Strings/StringStartsWithEndsWith/StringStartsWithEndsWith.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/strings/StringStartsWithEndsWith + https://docs.arduino.cc/built-in-examples/strings/StringStartsWithEndsWith/ */ void setup() { diff --git a/examples/08.Strings/StringSubstring/StringSubstring.ino b/examples/08.Strings/StringSubstring/StringSubstring.ino index dac9ae9..0083212 100644 --- a/examples/08.Strings/StringSubstring/StringSubstring.ino +++ b/examples/08.Strings/StringSubstring/StringSubstring.ino @@ -9,7 +9,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/strings/StringSubstring + https://docs.arduino.cc/built-in-examples/strings/StringSubstring/ */ void setup() { diff --git a/examples/08.Strings/StringToInt/StringToInt.ino b/examples/08.Strings/StringToInt/StringToInt.ino index 96ab920..c59a851 100644 --- a/examples/08.Strings/StringToInt/StringToInt.ino +++ b/examples/08.Strings/StringToInt/StringToInt.ino @@ -12,7 +12,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/strings/StringToInt + https://docs.arduino.cc/built-in-examples/strings/StringToInt/ */ String inString = ""; // string to hold input diff --git a/examples/09.USB/Keyboard/KeyboardLogout/KeyboardLogout.ino b/examples/09.USB/Keyboard/KeyboardLogout/KeyboardLogout.ino index 6bab638..e5a2572 100644 --- a/examples/09.USB/Keyboard/KeyboardLogout/KeyboardLogout.ino +++ b/examples/09.USB/Keyboard/KeyboardLogout/KeyboardLogout.ino @@ -22,7 +22,7 @@ This example is in the public domain. - https://docs.arduino.cc/built-in-examples/usb/KeyboardLogout + https://docs.arduino.cc/built-in-examples/usb/KeyboardLogout/ */ #define OSX 0 diff --git a/examples/09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino b/examples/09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino index 45df865..02ca922 100644 --- a/examples/09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino +++ b/examples/09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino @@ -17,7 +17,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/usb/KeyboardMessage + https://docs.arduino.cc/built-in-examples/usb/KeyboardMessage/ */ #include "Keyboard.h" diff --git a/examples/09.USB/Keyboard/KeyboardReprogram/KeyboardReprogram.ino b/examples/09.USB/Keyboard/KeyboardReprogram/KeyboardReprogram.ino index 6e1a872..f6ae5f3 100644 --- a/examples/09.USB/Keyboard/KeyboardReprogram/KeyboardReprogram.ino +++ b/examples/09.USB/Keyboard/KeyboardReprogram/KeyboardReprogram.ino @@ -22,7 +22,7 @@ This example is in the public domain. - https://docs.arduino.cc/built-in-examples/usb/KeyboardReprogram + https://docs.arduino.cc/built-in-examples/usb/KeyboardReprogram/ */ #include "Keyboard.h" diff --git a/examples/09.USB/Keyboard/KeyboardSerial/KeyboardSerial.ino b/examples/09.USB/Keyboard/KeyboardSerial/KeyboardSerial.ino index 411adfb..db5fb3d 100644 --- a/examples/09.USB/Keyboard/KeyboardSerial/KeyboardSerial.ino +++ b/examples/09.USB/Keyboard/KeyboardSerial/KeyboardSerial.ino @@ -16,7 +16,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/usb/KeyboardSerial + https://docs.arduino.cc/built-in-examples/usb/KeyboardSerial/ */ #include "Keyboard.h" diff --git a/examples/09.USB/KeyboardAndMouseControl/KeyboardAndMouseControl.ino b/examples/09.USB/KeyboardAndMouseControl/KeyboardAndMouseControl.ino index ea2c439..ffe82ac 100644 --- a/examples/09.USB/KeyboardAndMouseControl/KeyboardAndMouseControl.ino +++ b/examples/09.USB/KeyboardAndMouseControl/KeyboardAndMouseControl.ino @@ -18,7 +18,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/usb/KeyboardAndMouseControl + https://docs.arduino.cc/built-in-examples/usb/KeyboardAndMouseControl/ */ #include "Keyboard.h" diff --git a/examples/09.USB/Mouse/ButtonMouseControl/ButtonMouseControl.ino b/examples/09.USB/Mouse/ButtonMouseControl/ButtonMouseControl.ino index 7547c55..6eb0e4d 100644 --- a/examples/09.USB/Mouse/ButtonMouseControl/ButtonMouseControl.ino +++ b/examples/09.USB/Mouse/ButtonMouseControl/ButtonMouseControl.ino @@ -20,7 +20,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/usb/ButtonMouseControl + https://docs.arduino.cc/built-in-examples/usb/ButtonMouseControl/ */ #include "Mouse.h" diff --git a/examples/09.USB/Mouse/JoystickMouseControl/JoystickMouseControl.ino b/examples/09.USB/Mouse/JoystickMouseControl/JoystickMouseControl.ino index eba0bc1..13e170c 100644 --- a/examples/09.USB/Mouse/JoystickMouseControl/JoystickMouseControl.ino +++ b/examples/09.USB/Mouse/JoystickMouseControl/JoystickMouseControl.ino @@ -26,7 +26,7 @@ This example code is in the public domain. - https://docs.arduino.cc/built-in-examples/usb/JoystickMouseControl + https://docs.arduino.cc/built-in-examples/usb/JoystickMouseControl/ */ #include "Mouse.h" From 61156f797b0585f4c8fcc04a7666adf829dee3ec Mon Sep 17 00:00:00 2001 From: fritzlb <106099434+fritzlb@users.noreply.github.com> Date: Mon, 11 Mar 2024 19:03:35 +0100 Subject: [PATCH 50/59] Add hint MISO/MOSI -> CIPO/COPI The Arduino documentation uses the new CIPO/COPI terminology while the whole arduino core still uses the old MISO/MOSI. While I thought about changing everything in the arduino cores, this would break many old sketches so I figuered adding a hint is the way to go. Also, only changing terminology in this sketch doesn't work for consistency reasons, eg. beginning in line 106. --- examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino b/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino index bbbcdc9..c614c91 100644 --- a/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino +++ b/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino @@ -3,6 +3,9 @@ // If you require a license, see // https://opensource.org/licenses/bsd-license.php // +// Please note that this sketch still uses MISO/MOSI instead of CIPO/COPI. +// For further details, see https://docs.arduino.cc/learn/communication/spi +// // This sketch turns the Arduino into a AVRISP using the following Arduino pins: // // Pin 10 is used to reset the target microcontroller. From 58cf44a15a18560087ac18fc23238e437867dac9 Mon Sep 17 00:00:00 2001 From: fritzlb <106099434+fritzlb@users.noreply.github.com> Date: Mon, 11 Mar 2024 22:54:11 +0100 Subject: [PATCH 51/59] Update examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino Co-authored-by: per1234 --- examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino b/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino index c614c91..6ceb85f 100644 --- a/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino +++ b/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino @@ -3,7 +3,8 @@ // If you require a license, see // https://opensource.org/licenses/bsd-license.php // -// Please note that this sketch still uses MISO/MOSI instead of CIPO/COPI. +// Note that this sketch refers to the SPI bus pins using the legacy MISO/MOSI +// names rather than the modern CIPO/COPI names. // For further details, see https://docs.arduino.cc/learn/communication/spi // // This sketch turns the Arduino into a AVRISP using the following Arduino pins: From 2b0e9d3a0b1be986e16448d17e3a7337382e81ce Mon Sep 17 00:00:00 2001 From: per1234 Date: Thu, 13 Jun 2024 11:56:25 -0700 Subject: [PATCH 52/59] Automatically assign per1234 to Dependabot PRs As the primary maintainer of the project infrastructure, it is the responsibility of GitHub user per1234 to review and merge the pull requests automatically submitted by Dependabot for bumps of outdated project dependencies. Configuring Dependabot to automatically set the pull request assignment will slightly streamline that process. --- .github/dependabot.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index fd7388a..f640b03 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,6 +7,8 @@ updates: # See: https://docs.github.com/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot - package-ecosystem: github-actions directory: / # Check the repository's workflows under /.github/workflows/ + assignees: + - per1234 schedule: interval: daily labels: From 86d9db63e2c30770e4bce3765ae7018ed4e8d397 Mon Sep 17 00:00:00 2001 From: per1234 Date: Thu, 13 Jun 2024 11:56:40 -0700 Subject: [PATCH 53/59] Don't limit number of open Dependabot pull requests The Dependabot service is used to keep the project dependencies updated. Thanks to the project's high quality validation infrastructure, the human effort required to complete a trivial version bump is minimal. However, some bumps may introduce breaking changes that would require a significant amount of effort to accommodate, or are blocked by external tasks. In this case, the Dependabot pull request can't be merged, but should be left open to track the need to perform the bump when it is feasible. This means that it should be expected that there will be regularly be a small number of Dependabot pull requests left open in the repository over long periods of time. The automated system is here to assist the human project maintainers, not as a tyrannical overlord, so this is the system working exactly as intended. By default, Dependabot is configured to stop submitting pull requests if it already has five open pull requests. This means that if it happens that the accumulation of intentionally on-hold pull requests reaches that number, the project stops receiving the easily handled trivial update PRs. This is very harmful because it results in the completely unnecessary use of outdated dependencies, and unnecessary challenging large bumps when pull requests start being submitted once more after the backlog is cleared. The harmful default configuration is hereby overridden by configuring the maximum open pull request limit at 100. This value was chosen as an arbitrary large number simply to functionally disable the limiting, rather than from any expectation that the actual number of open PRs can ever reach that count. --- .github/dependabot.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f640b03..621d3f2 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,6 +9,7 @@ updates: directory: / # Check the repository's workflows under /.github/workflows/ assignees: - per1234 + open-pull-requests-limit: 100 schedule: interval: daily labels: From 7f75d462c3eeb05bbcb58eca18a8a1ce26f21ea2 Mon Sep 17 00:00:00 2001 From: per1234 Date: Wed, 11 Sep 2024 04:33:57 -0700 Subject: [PATCH 54/59] Only delay after serial output in "Knock" The "Knock" sketch polls the voltage output from a piezo disc to detect the vibrations associated with a knock. The duration of vibrations from a single knock is likely to significantly exceed the unchecked polling interval. This would result in a single knock producing multiple detections, and thus multiple prints to Serial. In order to avoid this, a "debouncing" delay was added to the sketch. Previously the delay was positioned in the outer scope of the `loop` function, which caused it to always affect the polling interval. This caused the sketch to miss the detection of knocks that produced vibrations that only occurred during that unnecessary delay. The problem is fixed by moving the delay inside the knock detection conditional block, so that debouncing is only done when actually needed. --- examples/06.Sensors/Knock/Knock.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/06.Sensors/Knock/Knock.ino b/examples/06.Sensors/Knock/Knock.ino index fa174a1..46047d9 100644 --- a/examples/06.Sensors/Knock/Knock.ino +++ b/examples/06.Sensors/Knock/Knock.ino @@ -49,6 +49,6 @@ void loop() { digitalWrite(ledPin, ledState); // send the string "Knock!" back to the computer, followed by newline Serial.println("Knock!"); + delay(100); // delay to avoid overloading the serial port buffer } - delay(100); // delay to avoid overloading the serial port buffer } From 9f74e1a5a4615ca54c3db19f02362fbb339c6e0d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 08:37:04 +0000 Subject: [PATCH 55/59] Bump actions/upload-artifact from 3 to 4 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/sync-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 9cde1ac..7680b37 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -70,7 +70,7 @@ jobs: file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }} - name: Pass configuration files to next job via workflow artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: | *.yaml From bf7b8b70e3a92ba5d6fd0f5fbb08edc14d8f18ac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Dec 2023 18:38:14 +0000 Subject: [PATCH 56/59] Bump actions/download-artifact from 3 to 4 Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/sync-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 7680b37..2e1d6e0 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -108,7 +108,7 @@ jobs: uses: actions/checkout@v4 - name: Download configuration files artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ env.CONFIGURATIONS_ARTIFACT }} path: ${{ env.CONFIGURATIONS_FOLDER }} From ce3cef9c4bd4fd8abab10b530d5d583dcefc1ebd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 13 Jun 2024 19:17:09 +0000 Subject: [PATCH 57/59] Bump geekyeggo/delete-artifact from 2 to 5 Bumps [geekyeggo/delete-artifact](https://github.com/geekyeggo/delete-artifact) from 2 to 5. - [Release notes](https://github.com/geekyeggo/delete-artifact/releases) - [Changelog](https://github.com/GeekyEggo/delete-artifact/blob/main/CHANGELOG.md) - [Commits](https://github.com/geekyeggo/delete-artifact/compare/v2...v5) --- updated-dependencies: - dependency-name: geekyeggo/delete-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/sync-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 2e1d6e0..53a9f54 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -114,7 +114,7 @@ jobs: path: ${{ env.CONFIGURATIONS_FOLDER }} - name: Remove unneeded artifact - uses: geekyeggo/delete-artifact@v2 + uses: geekyeggo/delete-artifact@v5 with: name: ${{ env.CONFIGURATIONS_ARTIFACT }} From 1b9c4c42ef39f980be203ecc64bdba778f9a8bbf Mon Sep 17 00:00:00 2001 From: per1234 Date: Wed, 9 Oct 2024 05:07:47 -0700 Subject: [PATCH 58/59] Don't upload multiple times to same artifact in label sync workflow The "Sync Labels" GitHub Actions workflow is configured to allow the use of multiple shared label configuration files. This is done by using a job matrix in the GitHub Actions workflow to download each of the files from the source repository in a parallel GitHub Actions workflow job. A GitHub Actions workflow artifact was used to transfer the generated files between sequential jobs in the workflow. The "actions/upload-artifact" and "actions/download-artifact" actions are used for this purpose. Previously, a single artifact was used for the transfer of all the shared label configuration files, with each of the parallel jobs uploading its own generated files to that artifact. However, support for uploading multiple times to a single artifact was dropped in version 4.0.0 of the "actions/upload-artifact" action. So it is now necessary to use a dedicated artifact for each of the builds. These can be downloaded in aggregate by using the artifact name globbing and merging features which were introduced in version 4.1.0 of the "actions/download-artifact" action. --- .github/workflows/sync-labels.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 53a9f54..514f29a 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -19,7 +19,7 @@ on: env: CONFIGURATIONS_FOLDER: .github/label-configuration-files - CONFIGURATIONS_ARTIFACT: label-configuration-files + CONFIGURATIONS_ARTIFACT_PREFIX: label-configuration-file- jobs: check: @@ -76,7 +76,7 @@ jobs: *.yaml *.yml if-no-files-found: error - name: ${{ env.CONFIGURATIONS_ARTIFACT }} + name: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}${{ matrix.filename }} sync: needs: download @@ -107,16 +107,17 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Download configuration files artifact + - name: Download configuration file artifacts uses: actions/download-artifact@v4 with: - name: ${{ env.CONFIGURATIONS_ARTIFACT }} + merge-multiple: true + pattern: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}* path: ${{ env.CONFIGURATIONS_FOLDER }} - - name: Remove unneeded artifact + - name: Remove unneeded artifacts uses: geekyeggo/delete-artifact@v5 with: - name: ${{ env.CONFIGURATIONS_ARTIFACT }} + name: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}* - name: Merge label configuration files run: | From e695e8e3fc0f4ebe4df49ebf25fceccda9528a97 Mon Sep 17 00:00:00 2001 From: Per Tillisch Date: Sun, 16 Feb 2025 10:33:06 -0800 Subject: [PATCH 59/59] Document incomplete nature of "p08_DigitalHourglass" The sketches under the "10.StarterKit_BasicKit" folder are provided to accompany the Arduino Projects Book of the Arduino Starter Kit. The Arduino Projects Book explains the code of these sketches and gives instructions for their usage. In addition to owners of the Arduino Starter Kit, other users might use these prominent sketches as learning references. Those users won't have the context that would be provided by the Arduino Projects Book. For this reason, explanatory comments have been added to these sketches. The "p08_DigitalHourglass" is unique in that it is intentionally left incomplete. The Arduino Projects Book instructs the user to add their own code to indicate the completion of the timer. It is important that this code be added, since the incomplete code does not halt the LED control code at the end of the hour. If the incomplete code is used unchanged, the LED control code will call `digitalWrite` on additional pins. Previously, the comments in the sketch did not explain the incomplete nature of the sketch. Comments are hereby added to explain this to users who don't have the context provided by the Arduino Projects Book. --- .../p08_DigitalHourglass/p08_DigitalHourglass.ino | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/10.StarterKit_BasicKit/p08_DigitalHourglass/p08_DigitalHourglass.ino b/examples/10.StarterKit_BasicKit/p08_DigitalHourglass/p08_DigitalHourglass.ino index 9fbbc18..3122c67 100644 --- a/examples/10.StarterKit_BasicKit/p08_DigitalHourglass/p08_DigitalHourglass.ino +++ b/examples/10.StarterKit_BasicKit/p08_DigitalHourglass/p08_DigitalHourglass.ino @@ -10,6 +10,9 @@ - six LEDs - tilt switch + NOTE: This sketch is intentionally incomplete. Make sure to add your own code + for whatever you want to happen at the end of the hour. + created 13 Sep 2012 by Scott Fitzgerald @@ -55,6 +58,7 @@ void loop() { if (led == 7) { // the hour is up + // add your indicator code here } }