   digitalWrite(out, HIGH);
   digitalWrite(debug, HIGH);
   Serial.begin(9600);
-  Serial.println("Start");
+  Serial.print("Start. timerPreload=");
+  Serial.println(timerPreload);
+  setupTimer();
 }
 
 void sendSequence(const unsigned char* seq)


#endif


void pulse(int length, int value)
{
  digitalWrite(out, value);
  digitalWrite(debug, value);
  time += 52 * length;
  delayMicroseconds(time - micros());
//  delayMicroseconds(length * 52);
}

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

    }
  }
  Serial.println();
}

// sends stuff from sequence, sequenceAtBit/sequenceAtByte
void sendBinarySequenceHw()
{
  noInterrupts();
  writeBitsLeft = sequenceAt * 8 + sequenceAtBit;
  writeCurBit = 0;
  writeCurByte = 0;
  interrupts();
  
  while (writeBitsLeft > 0) {
    // wait for writing to go through
  }
  Serial.println(".");
}

void doit() {
  sendSequence(initsequence);
}

void baseLoop() {
  if (Serial.available()) {
