 
 enum pins {
 	RECEIVE_PIN = 11,
-	LED1_PIN = 13,
 };
 
+enum { MAX_BILLS = 4 };
+
 RH_ASK radio(2000, RECEIVE_PIN, NULL);
-
-static void led1_on(void) {
-	digitalWrite(LED1_PIN, HIGH);
-}
-
-static void led1_off(void) {
-	digitalWrite(LED1_PIN, LOW);
-}
-
-static void led1_toggle(void) {
-	int x = digitalRead(LED1_PIN);
-	digitalWrite(LED1_PIN, !x);
-}
+uint8_t bills[MAX_BILLS];
+uint8_t bills_count;
+uint8_t prev_bill;
 
 void setup() {
 #	ifdef DEBUG

	Serial.println("Initializing radio");
#	endif

	pinMode(LED1_PIN, OUTPUT);

	led1_off();

	if (!radio.init()) {
#		ifdef DEBUG

	uint8_t buflen = sizeof(buf);

	if (radio.recv(buf, &buflen)) {
		uint8_t n = atoi((const char *) buf);
		if (n != prev_bill) {
			bills[bills_count] = n;
			lcd_clear();
			lcd_printf("%2d%2d%2d%2d", bills[0], bills[1], bills[2], bills[3]);
			bills_count = (bills_count + 1) % MAX_BILLS;
			prev_bill = n;
		}
#		ifdef DEBUG
		radio.printBuffer("Received:", buf, buflen);
		Serial.println("bills:");
		Serial.println(bills[0]);
		Serial.println(bills[1]);
		Serial.println(bills[2]);
		Serial.println(bills[3]);
		Serial.println();
#		endif
	}
}
