 	pinMode(LED, OUTPUT);
 	pinMode(BTX, OUTPUT);
 	pinMode(BRX, INPUT);
+	Serial.begin(9600);
+}
+
+int bytevalue() {
+	int value=0;
+	int power=1;
+	int i=0;
+	while (i<8) {
+		if (bytebits[i++])
+			value = value + power;
+		power = power * 2;
+	}
+	return value;
 }
 
 int readFrame(int cyclecount0, int cyclecount1)

	sendCarrier(BTX, sleepms);
	sendCarrier(BTX, sleepms);
}


		bytebits[--i] = frame;
	}
	digitalWrite(LED, LOW);
	Serial.print("byte read: ");
	Serial.println(bytevalue());
	for(i=0; i<32; i++) {
		sendCarrier(BTX, sleepms);
	}
