Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated pin assignments in play_notes to match MIDI shield

  • Loading branch information...
commit 0c3d5b83a3e92e3bcd33df48e29ab8683c852e63 1 parent fe52e6f
@vinmarshall authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 play_notes/play_notes.pde
View
10 play_notes/play_notes.pde
@@ -38,9 +38,9 @@
#include <SparkSoftLCD.h> // download from http://openmoco.org/node/153
#include <MIDI.h> // download from http://sourceforge.net/projects/arduinomidilib
-#define BUTTON_PIN 2 // Pushbutton
-#define LCD_PIN 4 // Serial LCD RX line
-#define POT_PIN A0 // Potentiometer wiper
+#define BUTTON_PIN 2 // Pushbutton (MIDI Shield button D2)
+#define LCD_PIN 5 // Serial LCD RX line
+#define POT_PIN A0 // Potentiometer wiper (MIDI Shield knob A0)
#define CHANNEL 1 // MIDI Channel
SparkSoftLCD lcd = SparkSoftLCD(LCD_PIN); // Serial LCD
@@ -54,6 +54,7 @@ int note; // note to be played
void setup() {
// Serial LCD Setup
pinMode(LCD_PIN, OUTPUT);
+ delay(500);
lcd.begin(9600);
lcd.clear();
lcd.cursor(0); // hide cursor
@@ -64,6 +65,7 @@ void setup() {
// Other I/O Setup
pinMode(BUTTON_PIN, INPUT);
+ digitalWrite(BUTTON_PIN, HIGH);
}
void loop() {
@@ -75,7 +77,7 @@ void loop() {
*/
// Read button state and mark time if it's changed
- bool btnReading = digitalRead(BUTTON_PIN);
+ bool btnReading = ! digitalRead(BUTTON_PIN); // negate - button pulls low
if (btnReading != lastBtnState) {
debounceTime = millis();
}
Please sign in to comment.
Something went wrong with that request. Please try again.