Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: arduino/arduino-examples
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.10.0
Choose a base ref
...
head repository: arduino/arduino-examples
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1.10.1
Choose a head ref
  • 11 commits
  • 6 files changed
  • 3 contributors

Commits on Oct 12, 2022

  1. 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](GeekyEggo/delete-artifact@v1...v2)
    
    ---
    updated-dependencies:
    - dependency-name: geekyeggo/delete-artifact
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    dependabot[bot] authored Oct 12, 2022
    Copy the full SHA
    dfbe14a View commit details
  2. Merge pull request #59 from arduino/dependabot/github_actions/geekyeg…

    …go/delete-artifact-2
    
    Bump geekyeggo/delete-artifact from 1 to 2
    per1234 authored Oct 12, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    41d7959 View commit details

Commits on Oct 24, 2022

  1. 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](carlosperate/download-file-action@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] <[email protected]>
    dependabot[bot] authored Oct 24, 2022
    Copy the full SHA
    c6d8f98 View commit details

Commits on Oct 25, 2022

  1. Merge pull request #60 from arduino/dependabot/github_actions/carlosp…

    …erate/download-file-action-2
    
    Bump carlosperate/download-file-action from 1 to 2
    per1234 authored Oct 25, 2022
    Copy the full SHA
    507d2a0 View commit details

Commits on Dec 27, 2022

  1. Copy the full SHA
    5a1bd3f View commit details
  2. Merge pull request #61 from THE-Spellchecker/main

    Corrected Comment in AnalogInput.ino
    per1234 authored Dec 27, 2022
    Copy the full SHA
    eb709fa View commit details

Commits on Sep 4, 2023

  1. 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](actions/checkout@v3...v4)
    
    ---
    updated-dependencies:
    - dependency-name: actions/checkout
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    dependabot[bot] authored Sep 4, 2023
    Copy the full SHA
    74be767 View commit details
  2. Merge pull request #65 from arduino/dependabot/github_actions/actions…

    …/checkout-4
    
    Bump actions/checkout from 3 to 4
    per1234 authored Sep 4, 2023
    Copy the full SHA
    fdbfc5b View commit details

Commits on Dec 30, 2023

  1. 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.
    per1234 committed Dec 30, 2023
    Copy the full SHA
    fdbc6ba View commit details
  2. 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.
    per1234 committed Dec 30, 2023
    Copy the full SHA
    9806d58 View commit details
  3. Merge pull request #71 from per1234/spi-macro-namespace

    Use distinctive names for SPI pin macros to avoid collisions
    per1234 authored Dec 30, 2023
    Copy the full SHA
    1d7b1fb View commit details
2 changes: 1 addition & 1 deletion .github/workflows/code-formatting-check.yml
Original file line number Diff line number Diff line change
@@ -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
32 changes: 31 additions & 1 deletion .github/workflows/compile-examples.yml
Original file line number Diff line number Diff line change
@@ -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
@@ -212,7 +242,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Compile examples
uses: arduino/compile-sketches@v1
2 changes: 1 addition & 1 deletion .github/workflows/spell-check.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
@@ -27,11 +27,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- 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://github.com/raw/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://github.com/raw/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }}

@@ -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
@@ -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 }}

2 changes: 1 addition & 1 deletion examples/03.Analog/AnalogInput/AnalogInput.ino
Original file line number Diff line number Diff line change
@@ -45,6 +45,6 @@ void loop() {
delay(sensorValue);
// turn the ledPin off:
digitalWrite(ledPin, LOW);
// stop the program for for <sensorValue> milliseconds:
// stop the program for <sensorValue> milliseconds:
delay(sensorValue);
}
54 changes: 27 additions & 27 deletions examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino
Original file line number Diff line number Diff line change
@@ -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;