/*
The 433.92 Mhz receivers have AGC, if no signal is present the gain will be set 
to its highest level.

In this condition it will switch high to low at random intervals due to input noise.
A CRO connected to the data line looks like 433.92 is full of transmissions.

Any ASK transmission method must first sent a capture signal of 101010........
When the receiver has adjusted its AGC to the required level for the transmisssion
the actual data transmission can occur.

We send 14 0's 1010...    It takes 1 to 3 10's for the receiver to adjust to 
the transmit level.

The receiver waits until we have at least 10 10's and then a start pulse 01.
The receiver is then operating correctly and we have locked onto the transmission.
*/
void MANCHESTERClass::TransmitBytes(unsigned char numBytes, unsigned char *data)
{
  // Setup last send time so we start transmitting in 10us
  lastSend = micros() - HALF_BIT_INTERVAL + 10;

  // Send 14 0's
  for( int i = 0; i < 14; i++) //send capture pulses
    sendzero();  //end of capture pulses
 
  // Send a single 1
  sendone();  //start data pulse
 
  // Send the user data
  for (unsigned char i = 0; i < numBytes; i++)
  {
    unsigned int mask = 0x01; //mask to send bits 
    for (char j = 0; j < 8; j++)
    {
      if ((data[i] & mask) == 0)
        sendzero();
      else
        sendone();
      mask = mask << 1; //get next bit
    }//end of byte
  }//end of data

  // Send 2 terminatings 0's
  sendzero();
  sendzero();  
}//end of send the data	
void DCF77Transmitter::sendstream(boolean report) {
	if (report)
		Serial.print("DCF Stream: ");
	
  for (int i = 0; i < horizon; i++) {
    if (iDateTime[i])
      sendone();
    else
      sendzero();
    if (report) {
      if (i ==  1 || i == 15 || i == 21 || i == 29 || i == 36 || i == 42 || i == 45 || i == 50)
        Serial.print("-");
      if (i == 28 || i == 35 || i == 58)
        Serial.print("P");
      Serial.print(iDateTime[i]);
  	}
  }
  if (iDateTime[19]) {
    sendzero();
    if (report)
    	Serial.print(!iDateTime[19]);
  }
  lastsecond();
  if (report)
  	Serial.println(" End");
}