 }
 
 void sendByte(byte value) {
+	byte i;
+	digitalWrite(BTX, LOW);
+	for(i=0; i<16; i++) {
+		sendCarrier(BTX, sleepms);
+	}
 	bytebitsSet(value);
 	sendBytebits();
+	sendCarrier(BTX, sleepms);
+	sendCarrier(BTX, sleepms);
 }
 
 byte getByte() {
-	int frame,i;
+	byte frame,i;
 	i=8;
 	while (i) {
 		while((frame = getFrame(BRX)) >= CARRIER) {
+			if (frame == NOFRAME) {
+				if (Serial.available() > 0) {
+					digitalWrite(LED, HIGH);
+					frame = Serial.parseInt();
+					digitalWrite(LED, LOW);
+					return frame;
+				}
+			}
 			i=8;
 		}
 		bytebits[--i] = frame;


void loop() {
	unsigned int angle;
	int i;
	digitalWrite(LED, LOW);
	digitalWrite(BTX, LOW);
	for(i=0; i<16; i++) {
		sendCarrier(BTX, sleepms);
	}
	sendByte(iobyte);
	sendCarrier(BTX, sleepms);
	sendCarrier(BTX, sleepms);
	Serial.print("byte sent: ");
	Serial.println(iobyte);
	iobyte=getByte();
	digitalWrite(LED, HIGH);
	Serial.print("byte read: ");
	Serial.println(iobyte);
	angle=((unsigned int)iobyte)*180/255;

	pinMode(BRX, INPUT);
	servo.attach(SRV);
	Serial.begin(9600);
	sleepms = 5;
	iobyte = 128;
}

byte bytebitsGet() {
