From 5699e3fe003c0dd7ac7082d82e4db21d24d335ba Mon Sep 17 00:00:00 2001 From: lathoub Date: Sun, 22 Mar 2020 15:34:12 +0100 Subject: [PATCH] cleanup of basic example use LED_BUILTIN --- examples/Basic_IO/Basic_IO.ino | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/examples/Basic_IO/Basic_IO.ino b/examples/Basic_IO/Basic_IO.ino index 434cf3f..8209719 100644 --- a/examples/Basic_IO/Basic_IO.ino +++ b/examples/Basic_IO/Basic_IO.ino @@ -6,11 +6,9 @@ MIDI_CREATE_DEFAULT_INSTANCE(); -static const unsigned ledPin = 13; // LED pin on Arduino Uno - void setup() { - pinMode(ledPin, OUTPUT); + pinMode(LED_BUILTIN, OUTPUT); MIDI.begin(4); // Launch MIDI and listen to channel 4 } @@ -18,10 +16,10 @@ void loop() { if (MIDI.read()) // If we have received a message { - digitalWrite(ledPin, HIGH); + digitalWrite(LED_BUILTIN, HIGH); MIDI.sendNoteOn(42, 127, 1); // Send a Note (pitch 42, velo 127 on channel 1) delay(1000); // Wait for a second MIDI.sendNoteOff(42, 0, 1); // Stop the note - digitalWrite(ledPin, LOW); + digitalWrite(LED_BUILTIN, LOW); } }