8000 Merge pull request #371 from LightningStalker/master · ArduinoWorks/Arduino_STM32@a7503e1 · GitHub
[go: up one dir, main page]

Skip to content

Commit a7503e1

Browse files
Merge pull request rogerclarkmelbourne#371 from LightningStalker/master
Update BlinkNcount.ino to use LED_BUILTIN rather than a pin number (which is specific to one board). Note. LED_BUILTIN needs to be defined for some variants where its missing
2 parents 3ff1b80 + fd00f02 commit a7503e1

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

STM32F1/libraries/A_STM32_Examples/examples/General/BlinkNcount/BlinkNcount.ino

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,27 @@
99
int n = 0;
1010

1111

12-
void setup() {
12+
void setup() {
1313
// initialize the digital pin as an output.
14-
pinMode(33, OUTPUT);
14+
pinMode(LED_BUILTIN, OUTPUT);
1515
// Initialize virtual COM over USB on Maple Mini
1616
Serial.begin(9600); // BAUD has no effect on USB serial: placeholder for physical UART
1717
// wait for serial monitor to be connected.
1818
while (!Serial)
1919
{
20-
digitalWrite(33,!digitalRead(33));// Turn the LED from off to on, or on to off
20+
digitalWrite(LED_BUILTIN,!digitalRead(LED_BUILTIN)); // Turn the LED from off to on, or on to off
2121
delay(100); // fast blink
2222
}
2323
Serial.println("Blink LED & count Demo");
2424
}
2525

2626
void loop() {
27-
digitalWrite(33, HIGH); // set the LED on
27+
digitalWrite(LED_BUILTIN, HIGH); // set the LED on
2828
delay(500); // wait for a second
29-
digitalWrite(33, LOW); // set the LED off
29+
digitalWrite(LED_BUILTIN, LOW); // set the LED off
3030
Serial.print("Loop #: ");
3131
n++;
3232
Serial.println(n);
33-
34-
delay(500); // wait
33+
34+
delay(500); // wait
3535
}

STM32F1/variants/generic_stm32f103c/variant.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ static const uint8_t SCK = BOARD_SPI1_SCK_PIN;
1919

2020
#define LED_BUILTIN PC13
2121

22-
#endif /* _VARIANT_ARDUINO_STM32_ */
22+
#endif /* _VARIANT_ARDUINO_STM32_ */

0 commit comments

Comments
 (0)
0