 void loop()
 {
   // Main loop
-  // 8 ports, from 0 to 7
+  // LASTPORT+1 ports, from 0 to LASTPORT
   for (int i = 0; i <= LASTPORT; i++) {
+    r0 = bitRead(i,0);    // use this with arduino 0013 (and newer versions)     
+    r1 = bitRead(i,1);    // use this with arduino 0013 (and newer versions)     
+    r2 = bitRead(i,2);    // use this with arduino 0013 (and newer versions) 
+    digitalWrite(2, r0);
+    digitalWrite(3, r1);
+    digitalWrite(4, r2);
     if(digitalRead(BUTTONPORT) == HIGH) {
       // Make sure that this is the first time that the button
       // has been pressed

 */ 

// Port I/O defines
#define THRESHOLD 500
#define LASTPORT 7
#define BUTTONPORT 2

// MIDI property defines
#define VOLUME 0x7F

{
  // Initialize serial at 115200 baud
  Serial.begin(115200);
  pinMode(2,OUTPUT);
  pinMode(3,OUTPUT);
  pinMode(4,OUTPUT);
  // Wait 1 second for ttymidi to come up
  delay(1000);
}
