8000 Update BlinkNcount.ino to use LED_BUILTIN · ArduinoWorks/Arduino_STM32@fd00f02 · GitHub
[go: up one dir, main page]

Skip to content

Commit fd00f02

Browse files
Update BlinkNcount.ino to use LED_BUILTIN
1 parent de56edb commit fd00f02

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,32 @@
11
/*
2-
BlinkNcount for Maple Mini by m. ray burnette, update by The Lightning Stalker to use #define
2+
BlinkNcount for Maple Mini by m. ray burnette
33
Sketch uses 13,808 bytes (12%) of program storage space. Maximum is 108,000 bytes.
44
Global variables use 2,592 bytes of dynamic memory.
55
Turns on an LED on for one second, then off for one second, repeatedly.
66
Counts and displays the count on the attached serial monitor
77
This example code is in the public domain.
8-
*/
9-
10-
#define LED_PIN PC13 // Maple Mini LED is on PB1, other boards may vary
11-
8+
*/
129
int n = 0;
1310

1411

1512void setup() {
1613
// initialize the digital pin as an output.
17-
pinMode(LED_PIN, OUTPUT);
14+
pinMode(LED_BUILTIN, OUTPUT);
1815
// Initialize virtual COM over USB on Maple Mini
1916
Serial.begin(9600); // BAUD has no effect on USB serial: placeholder for physical UART
2017
// wait for serial monitor to be connected.
2118
while (!Serial)
2219
{
23-
digitalWrite(LED_PIN, !digitalRead(LED_PIN)); // 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
2421
delay(100); // fast blink
2522
}
2623
Serial.println("Blink LED & count Demo");
2724
}
2825

2926
void loop() {
30-
digitalWrite(LED_PIN, HIGH); // set the LED on
27+
digitalWrite(LED_BUILTIN, HIGH); // set the LED on
3128
delay(500); // wait for a second
32-
digitalWrite(LED_PIN, LOW); // set the LED off
29+
digitalWrite(LED_BUILTIN, LOW); // set the LED off
3330
Serial.print("Loop #: ");
3431
n++;
3532
Serial.println(n);

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