 
 void loop() {
 	int frame,i;
+	Serial.println("enter size:");
+	while(Serial.available() <= 0);
+	bytesbuf[0]=Serial.parseInt();
+	i=0;
+	while(i<bytesbuf[0]) {
+		while(Serial.available() <= 0);
+		bytesbuf[++i]=Serial.parseInt();
+	}
 	digitalWrite(LED, HIGH);
 	digitalWrite(BTX, LOW);
+	for(i=0; i<32; i++) {
+		sendCarrier(BTX, sleepms);
+	}
+	for(i=0; i<=bytesbuf[0]; i++) {
+		bytebitsSet(bytesbuf[i]);
+		sendBytebits();
+	}
+	sendCarrier(BTX, sleepms);
+	sendCarrier(BTX, sleepms);
 	i=8;
 	while (i) {
 		while((frame = getFrame(BRX)) == CARRIER) {

	return readFrame(cyclecount0, cyclecount1);
}

void sendCarrier(int pin, int sleepms)
{
	digitalWrite(pin, HIGH);

	}
	digitalWrite(LED, LOW);
	Serial.print("byte read: ");
	Serial.println(bytebitsGet());
}
