|
1 | 1 | /*
|
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 |
3 | 3 | Sketch uses 13,808 bytes (12%) of program storage space. Maximum is 108,000 bytes.
|
4 | 4 | Global variables use 2,592 bytes of dynamic memory.
|
5 | 5 | Turns on an LED on for one second, then off for one second, repeatedly.
|
6 | 6 | Counts and displays the count on the attached serial monitor
|
7 | 7 | 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 | + */ |
12 | 9 | int n = 0;
|
13 | 10 |
|
14 | 11 |
|
15 | 12 | void setup() { |
16 | 13 | // initialize the digital pin as an output.
|
17 |
| - pinMode(LED_PIN, OUTPUT); |
| 14 | + pinMode(LED_BUILTIN, OUTPUT); |
18 | 15 | // Initialize virtual COM over USB on Maple Mini
|
19 | 16 | Serial.begin(9600); // BAUD has no effect on USB serial: placeholder for physical UART
|
20 | 17 | // wait for serial monitor to be connected.
|
21 | 18 | while (!Serial)
|
22 | 19 | {
|
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 |
24 | 21 | delay(100); // fast blink
|
25 | 22 | }
|
26 | 23 | Serial.println("Blink LED & count Demo");
|
27 | 24 | }
|
28 | 25 |
|
29 | 26 | void loop() {
|
30 |
| - digitalWrite(LED_PIN, HIGH); // set the LED on |
| 27 | + digitalWrite(LED_BUILTIN, HIGH); // set the LED on |
31 | 28 | delay(500); // wait for a second
|
32 |
| - digitalWrite(LED_PIN, LOW); // set the LED off |
| 29 | + digitalWrite(LED_BUILTIN, LOW); // set the LED off |
33 | 30 | Serial.print("Loop #: ");
|
34 | 31 | n++;
|
35 | 32 | Serial.println(n);
|
|
0 commit comments