 
 }
 
-void pinChanged() {
-    if (pinChangeCount == 0) {
-        // first change should be high to low,
-        // second change should be low to high (for a zero)
-        pinChangeCount++;
-    } else {
-        if (!q.isEmpty()) {
-            pinChangeCount = 0;
-            sendByteOnPin(q.dequeue());
+void sendBytes() {
+    while (!q.isEmpty()) {
+        sendByteOnPin(q.dequeue());
+        // wait for low then high (for a zero)
+        while (digitalRead(d2) == 1) {
+          // busy
         }
-        else {
-          nextCharOkay = true;
+        while (digitalRead(d2) == 0) {
+          // busy
         }
     }
 }

//     p     q     r     s     t     u     v     w     x     y     z     {     |     }     ~    DEL
     0x5c, 0x52, 0x03, 0x06, 0x5e, 0x5b, 0x53, 0x55, 0x51, 0x58, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00}; // 7
     
     void setup() 
{
  // initialize serial communication at 57600 bits per second:
  Serial.begin(57600);

  //PORTD |= 0b00000100;

  pinMode(d2, INPUT); // listening pin

  // start the input pin off (meaning the bus is high, normal state)
  PORTD &= 0b11111011;
  pinMode(d1, INPUT_PULLUP);
}

// the loop routine runs over and over again forever:
