From c4fdb3700846aa3db76e8a10298d60d8deb7a665 Mon Sep 17 00:00:00 2001 From: agdl Date: Mon, 9 Jan 2017 11:45:45 +0100 Subject: [PATCH 1/2] USe LED_BUILTIN in BlinkWithoutDelay --- .../02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/shared/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino b/build/shared/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino index ca4ac95fadd..f6a6b9b2675 100644 --- a/build/shared/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino +++ b/build/shared/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino @@ -15,6 +15,8 @@ by Paul Stoffregen modified 11 Nov 2013 by Scott Fitzgerald + modified 9 Jan 2017 + by Arturo Guadalupi This example code is in the public domain. @@ -23,7 +25,7 @@ */ // constants won't change. Used here to set a pin number : -const int ledPin = 13; // 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 From 07464ded816dcf4b92daf6c4e1d5879af82d4d91 Mon Sep 17 00:00:00 2001 From: agdl Date: Mon, 9 Jan 2017 11:54:40 +0100 Subject: [PATCH 2/2] Improved comment --- .../02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/build/shared/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino b/build/shared/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino index f6a6b9b2675..6b8ae577d33 100644 --- a/build/shared/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino +++ b/build/shared/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino @@ -5,9 +5,12 @@ can run at the same time without being interrupted by the LED code. The circuit: - * LED attached from pin 13 to ground. - * Note: on most Arduinos, there is already an LED on the board - that's attached to pin 13, so no hardware is needed for this example. + * Use the onboard LED. + * Note: Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO + it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN 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 created 2005 by David A. Mellis