Update BlinkNcount.ino to use LED_BUILTIN
This commit is contained in:
parent
de56edb5b0
commit
fd00f02072
|
@ -1,35 +1,32 @@
|
|||
/*
|
||||
BlinkNcount for Maple Mini by m. ray burnette, update by The Lightning Stalker to use #define
|
||||
BlinkNcount for Maple Mini by m. ray burnette
|
||||
Sketch uses 13,808 bytes (12%) of program storage space. Maximum is 108,000 bytes.
|
||||
Global variables use 2,592 bytes of dynamic memory.
|
||||
Turns on an LED on for one second, then off for one second, repeatedly.
|
||||
Counts and displays the count on the attached serial monitor
|
||||
This example code is in the public domain.
|
||||
*/
|
||||
|
||||
#define LED_PIN PC13 // Maple Mini LED is on PB1, other boards may vary
|
||||
|
||||
*/
|
||||
int n = 0;
|
||||
|
||||
|
||||
void setup() {
|
||||
// initialize the digital pin as an output.
|
||||
pinMode(LED_PIN, OUTPUT);
|
||||
pinMode(LED_BUILTIN, OUTPUT);
|
||||
// Initialize virtual COM over USB on Maple Mini
|
||||
Serial.begin(9600); // BAUD has no effect on USB serial: placeholder for physical UART
|
||||
// wait for serial monitor to be connected.
|
||||
while (!Serial)
|
||||
{
|
||||
digitalWrite(LED_PIN, !digitalRead(LED_PIN)); // Turn the LED from off to on, or on to off
|
||||
digitalWrite(LED_BUILTIN,!digitalRead(LED_BUILTIN)); // Turn the LED from off to on, or on to off
|
||||
delay(100); // fast blink
|
||||
}
|
||||
Serial.println("Blink LED & count Demo");
|
||||
}
|
||||
|
||||
void loop() {
|
||||
digitalWrite(LED_PIN, HIGH); // set the LED on
|
||||
digitalWrite(LED_BUILTIN, HIGH); // set the LED on
|
||||
delay(500); // wait for a second
|
||||
digitalWrite(LED_PIN, LOW); // set the LED off
|
||||
digitalWrite(LED_BUILTIN, LOW); // set the LED off
|
||||
Serial.print("Loop #: ");
|
||||
n++;
|
||||
Serial.println(n);
|
||||
|
|
|
@ -19,4 +19,4 @@ static const uint8_t SCK = BOARD_SPI1_SCK_PIN;
|
|||
|
||||
#define LED_BUILTIN PC13
|
||||
|
||||
#endif /* _VARIANT_ARDUINO_STM32_ */
|
||||
#endif /* _VARIANT_ARDUINO_STM32_ */
|
||||
|
|
Loading…
Reference in New Issue