Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit bc6723c

Browse files
chiararuggerisergiotomasello
chiararuggeri
authored andcommittedApr 3, 2017
Changed LED BUILTIN from 13 to 9
1 parent 7a41606 commit bc6723c

File tree

17 files changed

+62
-60
lines changed

17 files changed

+62
-60
lines changed
 

‎libraries/BLE/examples/Central/led_switch_client/led_switch_client.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <BLECentralRole.h>
2424

2525
// LED and button pin
26-
#define LED_PIN 13
26+
#define LED_PIN LED_BUILTIN
2727
#define BUTTON_PIN USER1_BUTTON
2828

2929
// create central instance

‎libraries/BLE/examples/Central/multilink/multilink.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include <BLECentralRole.h>
2121

2222
// LED and button pin
23-
#define LED_PIN 13
23+
#define LED_PIN LED_BUILTIN
2424
#define BUTTON_PIN USER1_BUTTON
2525

2626
// create central instance

‎libraries/BLE/examples/Peripheral/led/led.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <BLEPeripheral.h>
1111

1212
// LED pin
13-
#define LED_PIN 13
13+
#define LED_PIN LED_BUILTIN
1414

1515
// create peripheral instance
1616
BLEPeripheralRole blePeripheral = BLEPeripheralRole();

‎libraries/BLE/examples/Peripheral/led_callback/led_callback.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <NFC.h>
1717

1818
// LED pin
19-
#define LED_PIN 13
19+
#define LED_PIN LED_BUILTIN
2020

2121
// create peripheral instance
2222
BLEPeripheral blePeripheral = BLEPeripheral();

‎libraries/BLE/examples/Peripheral/led_switch/led_switch.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <BLEPeripheral.h>
1414

1515
// LED and button pin
16-
#define LED_PIN 13
16+
#define LED_PIN LED_BUILTIN
1717
#define BUTTON_PIN USER1_BUTTON
1818

1919
// create peripheral instance

‎libraries/CIR/examples/Receiver/Receiver.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ void setup() {
3333
// start serial port at 115200 bps:
3434
Serial.begin(115200);
3535
// initialize the LED pin as an output:
36-
pinMode(13, OUTPUT);
36+
pinMode(LED_BUILTIN, OUTPUT);
3737
// turn LED off:
38-
digitalWrite(13, LOW);
38+
digitalWrite(LED_BUILTIN, LOW);
3939
// enable IR ready to receiver:
4040
Primo_CIR.enableReceiver();
4141
// turn LED on:
42-
digitalWrite(13, HIGH);
42+
digitalWrite(LED_BUILTIN, HIGH);
4343
}
4444

4545
void loop() {
@@ -51,12 +51,12 @@ void loop() {
5151

5252
void PrintCirReceiverResult() {
5353
// turn LED on:
54-
digitalWrite(13, HIGH);
54+
digitalWrite(LED_BUILTIN, HIGH);
5555
Serial.print("Data Code:");
5656
// convert to hex code and print:
5757
Serial.println(Primo_CIR.getDecode(),HEX);
5858
// new line:
5959
Serial.print('\n');
6060
// turn LED off:
61-
digitalWrite(13, LOW);
61+
digitalWrite(LED_BUILTIN, LOW);
6262
}

‎libraries/CIR/examples/Transmitter/Transmitter.ino

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,38 +35,38 @@ CIR Primo_CIR;
3535

3636
void setup() {
3737
// initialize the LED pin as an output:
38-
pinMode(13, OUTPUT);
38+
pinMode(LED_BUILTIN, OUTPUT);
3939
// turn LED off:
40-
digitalWrite(13, LOW);
40+
digitalWrite(LED_BUILTIN, LOW);
4141
// enable IR ready to transmitter:
4242
Primo_CIR.enableTransmitter();
4343
// initialize the pushbutton pin as an input:
4444
pinMode(USER1_BUTTON, INPUT);
4545
pinMode(USER2_BUTTON, INPUT);
4646
// turn LED on:
47-
digitalWrite(13, HIGH);
47+
digitalWrite(LED_BUILTIN, HIGH);
4848
}
4949

5050
void loop() {
5151
// check if the USER1 BUTTON is pressed:
5252
if (!digitalRead(USER1_BUTTON))
5353
{
5454
// turn LED on:
55-
digitalWrite(13, HIGH);
55+
digitalWrite(LED_BUILTIN, HIGH);
5656

5757
// sned hex code:
5858
Primo_CIR.sendEncode(HEX_1);
5959
// turn LED off:
60-
digitalWrite(13, LOW);
60+
digitalWrite(LED_BUILTIN, LOW);
6161
}
6262
// check if the USER2 BUTTON is pressed:
6363
else if (!digitalRead(USER2_BUTTON))
6464
{
6565
// turn LED on:
66-
digitalWrite(13, HIGH);
66+
digitalWrite(LED_BUILTIN, HIGH);
6767
// sned hex code:
6868
Primo_CIR.sendEncode(HEX_2);
6969
// turn LED off:
70-
digitalWrite(13, LOW);
70+
digitalWrite(LED_BUILTIN, LOW);
7171
}
7272
}

‎libraries/LowPower/examples/PowerDown/PowerDown.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
void setup() {
2525
Serial.begin(9600);
2626

27-
pinMode(13, OUTPUT);
28-
digitalWrite(13, HIGH);
27+
pinMode(LED_BUILTIN, OUTPUT);
28+
digitalWrite(LED_BUILTIN, HIGH);
2929
delay(500);
30-
digitalWrite(13, LOW);
30+
digitalWrite(LED_BUILTIN, LOW);
3131
delay(500);
3232

3333
//look for what peripheral woke up the board

‎libraries/LowPower/examples/standbyGPIO/standbyGPIO.ino

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void setup() {
2525

2626
Serial.begin(9600);
2727

28-
pinMode(13, OUTPUT);
28+
pinMode(LED_BUILTIN, OUTPUT);
2929
pinMode(USER1_BUTTON, INPUT);
3030
//attach an interrupt on button USER1 to wake up the board when a low level is detected
3131
attachInterrupt(USER1_BUTTON, myFunction, LOW);
@@ -34,27 +34,27 @@ void setup() {
3434

3535

3636
void loop() {
37-
digitalWrite(13, HIGH);
37+
digitalWrite(LED_BUILTIN, HIGH);
3838
delay(200);
39-
digitalWrite(13, LOW);
39+
digitalWrite(LED_BUILTIN, LOW);
4040
delay(200);
41-
digitalWrite(13, HIGH);
41+
digitalWrite(LED_BUILTIN, HIGH);
4242
delay(100);
43-
digitalWrite(13, LOW);
43+
digitalWrite(LED_BUILTIN, LOW);
4444
delay(100);
4545
Serial.println("Ready to go to bed...");
4646

4747
//enter in standby mode
4848
LowPower.standby();
4949

5050
Serial.println("Good morning to all!");
51-
digitalWrite(13, HIGH);
51+
digitalWrite(LED_BUILTIN, HIGH);
5252
delay(1000);
53-
digitalWrite(13, LOW);
53+
digitalWrite(LED_BUILTIN, LOW);
5454
delay(1000);
55-
digitalWrite(13, HIGH);
55+
digitalWrite(LED_BUILTIN, HIGH);
5656
delay(500);
57-
digitalWrite(13, LOW);
57+
digitalWrite(LED_BUILTIN, LOW);
5858
delay(500);
5959
}
6060

‎libraries/LowPower/examples/standbyTimer/standbyTimer.ino

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@
2424

2525
void setup() {
2626
Serial.begin(9600);
27-
pinMode(13, OUTPUT);
27+
pinMode(LED_BUILTIN, OUTPUT);
2828
}
2929

3030

3131
void loop() {
32-
digitalWrite(13, HIGH);
32+
digitalWrite(LED_BUILTIN, HIGH);
3333
delay(200);
34-
digitalWrite(13, LOW);
34+
digitalWrite(LED_BUILTIN, LOW);
3535
delay(200);
36-
digitalWrite(13, HIGH);
36+
digitalWrite(LED_BUILTIN, HIGH);
3737
delay(100);
38-
digitalWrite(13, LOW);
38+
digitalWrite(LED_BUILTIN, LOW);
3939
delay(100);
4040
Serial.println("Ready to go to bed...");
4141

@@ -44,13 +44,13 @@ void loop() {
4444
// LowPower.standby(5, myFunction, CONST_LATENCY); //constant latency mode
4545

4646
Serial.println("Good morning to all!");
47-
digitalWrite(13, HIGH);
47+
digitalWrite(LED_BUILTIN, HIGH);
4848
delay(1000);
49-
digitalWrite(13, LOW);
49+
digitalWrite(LED_BUILTIN, LOW);
5050
delay(1000);
51-
digitalWrite(13, HIGH);
51+
digitalWrite(LED_BUILTIN, HIGH);
5252
delay(500);
53-
digitalWrite(13, LOW);
53+
digitalWrite(LED_BUILTIN, LOW);
5454
delay(500);
5555

5656
}

‎libraries/PPI/PPI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ uint8_t event_index;
3535
uint8_t task_index;
3636

3737
uint32_t milliSec=1000;
38-
uint32_t outputPin=13;
38+
uint32_t outputPin=LED_BUILTIN;
3939
nrf_lpcomp_ref_t reference=REF_VDD_1_2;
4040
uint32_t inputPin=A0;
4141

‎libraries/PPI/examples/LowPowerBlink/LowPowerBlink.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ void setup() {
2323
//set an interval for the timer (in milliseconds)
2424
PPI.setTimerInterval(1000);
2525
//select the output pin
26-
PPI.setOutputPin(13);
26+
PPI.setOutputPin(LED_BUILTIN);
2727
//bind TIMER event to PIN_TOGGLE action
2828
PPI.setShortcut(TIMER, PIN_TOGGLE);
2929

‎libraries/PPI/examples/SenseNFC/SenseNFC.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ PPI.setShortcut(COMP_DOWN, NFC_STOP_SENSE);
3232
PPI.setInputPin(4);
3333
PPI.setShortcut(PIN_HIGH, NFC_START_SENSE);
3434

35-
//Toggle pin 13 each time an NFC field is detected
36-
PPI.setOutputPin(13);
35+
//Toggle LED pin each time an NFC field is detected
36+
PPI.setOutputPin(LED_BUILTIN);
3737
PPI.setShortcut(NFC_FIELD_DETECTED, PIN_TOGGLE);
3838

3939
//Put mcu in standby mode to save power.

‎libraries/RTC/examples/ALARM_interrupt/ALARM_interrupt.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RTCInt rtc;
1616
void setup()
1717
{
1818
Serial.begin(9600); //serial communication initializing
19-
pinMode(13,OUTPUT);
19+
pinMode(LED_BUILTIN,OUTPUT);
2020
rtc.begin(TIME_H24); //RTC initializing with 24 hour representation mode
2121
rtc.setTime(17,0,5,0); //setting time (hour minute and second)
2222
rtc.setDate(13,8,15); //setting date
@@ -29,9 +29,9 @@ void setup()
2929

3030
void loop()
3131
{
32-
digitalWrite(13,HIGH); //main program code
32+
digitalWrite(LED_BUILTIN,HIGH); //main program code
3333
delay(100);
34-
digitalWrite(13,LOW);
34+
digitalWrite(LED_BUILTIN,LOW);
3535
delay(900);
3636

3737
}
@@ -43,10 +43,10 @@ void alarm_int(void)
4343
Serial.println("Alarm match!");
4444
for(int i=0; i < 10; i++)
4545
{
46-
digitalWrite(13,HIGH);
46+
digitalWrite(LED_BUILTIN,HIGH);
4747
//delay(200);
4848
for(int j=0; j < 1000000; j++) asm("NOP"); //in interrupt routine you cannot use delay function then an alternative is NOP instruction cicled many time as you need
49-
digitalWrite(13,LOW);
49+
digitalWrite(LED_BUILTIN,LOW);
5050
//delay(800);
5151
for(int j=0; j < 2000000; j++) asm("NOP");
5252
}

‎libraries/RTC/examples/ALARM_polled/ALARM_polled.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ RTCInt rtc;
1515
void setup()
1616
{
1717
Serial.begin(9600); //serial communication initializing
18-
pinMode(13,OUTPUT);
18+
pinMode(LED_BUILTIN,OUTPUT);
1919
rtc.begin(TIME_H24); //RTC initializing with 24 hour representation mode
2020
rtc.setTime(17,0,5,0); //setting time (hour minute and second)
2121
rtc.setDate(13,8,15); //setting date
@@ -29,19 +29,19 @@ void setup()
2929
void loop()
3030
{
3131

32-
digitalWrite(13,HIGH);
32+
digitalWrite(LED_BUILTIN,HIGH);
3333
delay(100);
34-
digitalWrite(13,LOW);
34+
digitalWrite(LED_BUILTIN,LOW);
3535
delay(400);
3636

3737
if(rtc.alarmMatch()) //when match occurs led on pin 13 blinks ten times
3838
{
3939
Serial.println("Alarm match!");
4040
for(int i=0; i < 10; i++)
4141
{
42-
digitalWrite(13,HIGH);
42+
digitalWrite(LED_BUILTIN,HIGH);
4343
delay(200);
44-
digitalWrite(13,LOW);
44+
digitalWrite(LED_BUILTIN,LOW);
4545
delay(800);
4646
}
4747
rtc.alarmClearFlag(); //clearing alarm flag

‎variants/arduino_primo/variant.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@
3434
* | | Digital High | | |
3535
* +------------+------------------+--------+-----------------+
3636
* | 8 | ~8 | P019 | |
37-
* | 9 | ~9 | P020 | |
37+
* | 9 | ~9 | P020 | LED |
3838
* | 10 | ~10 | P022 | |
3939
* | 11 | ~11 | P023 | |
4040
* | 12 | ~12 | P024 | |
41-
* | 13 | ~13 | P025 | LED |
41+
* | 13 | ~13 | P025 | |
4242
* +------------+------------------+--------+-----------------+
4343
* | | Analog Connector | | |
4444
* +------------+------------------+--------+-----------------+
@@ -113,20 +113,22 @@ const PinDescription g_APinDescription[]=
113113
{ PORT0, 11, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // RX
114114
{ PORT0, 12, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER}, // TX
115115

116-
// 2..12
116+
// 2..8
117117
{ PORT0, 13, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM0, NOT_ON_TIMER},
118118
{ PORT0, 14, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM1, NOT_ON_TIMER},
119119
{ PORT0, 15, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM2, NOT_ON_TIMER},
120120
{ PORT0, 16, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM3, NOT_ON_TIMER},
121121
{ PORT0, 17, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM4, NOT_ON_TIMER},
122122
{ PORT0, 18, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM5, NOT_ON_TIMER},
123123
{ PORT0, 19, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM6, NOT_ON_TIMER},
124+
125+
// 9 (LED)
124126
{ PORT0, 20, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM7, NOT_ON_TIMER},
127+
128+
// 10..13
125129
{ PORT0, 22, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM8, NOT_ON_TIMER},
126130
{ PORT0, 23, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM9, NOT_ON_TIMER},
127131
{ PORT0, 24, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM10, NOT_ON_TIMER},
128-
129-
// 13 (LED)
130132
{ PORT0, 25, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM11, NOT_ON_TIMER},
131133

132134
// 14..19 - Analog pins

‎variants/arduino_primo/variant.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ extern "C"{
7171
#define digitalPinHasPWM(P) ( g_APinDescription[P].ulPWMChannel != NOT_ON_PWM )
7272
#define digitalPinToInterrupt(P) ( P )
7373

74-
#define PIN_LED_13 (13u)
75-
#define PIN_LED PIN_LED_13
76-
#define LED_BUILTIN PIN_LED_13
74+
#define PIN_LED_9 (9u)
75+
#define PIN_LED PIN_LED_9
76+
#define LED_BUILTIN PIN_LED_9
7777
#define BUZZER (35u)
7878
#define USER1_BUTTON (34u)
7979

0 commit comments

Comments
 (0)
This repository has been archived.