 
 static char cmd;
 static byte value, stack[RF12_MAXDATA], top, sendLen, dest, quiet;
-static byte testbuf[RF12_MAXDATA], testCounter;
+static byte testbuf[RF12_MAXDATA], testCounter, useHex;
+
+static void showNibble (byte nibble) {
+    char c = '0' + (nibble & 0x0F);
+    if (c > '9')
+        c += 7;
+    Serial.print(c);
+}
+
+static void showByte (byte value) {
+    if (useHex) {
+        showNibble(value >> 4);
+        showNibble(value);
+    } else
+        Serial.print((int) value);
+}
 
 static void addCh (char* msg, char c) {
     byte n = strlen(msg);


    if (rf12_recvDone()) {
        byte n = rf12_len;
        if (rf12_crc == 0) {
            Serial.print("OK");
        } else {
            if (quiet)
                return;
            Serial.print(" ?");
            if (n > 20) // print at most 20 bytes if crc is wrong
                n = 20;
        }
        if (config.group == 0) {
            Serial.print("G ");
            Serial.print((int) rf12_grp);
        }
        Serial.print(' ');
        Serial.print((int) rf12_hdr);
        for (byte i = 0; i < n; ++i) {
            Serial.print(' ');
            Serial.print((int) rf12_data[i]);
        }
        Serial.println();
        

                    Sleepy::powerDown();
                }
                break;
            case 'x': // set reporting mode to hex (1) or decimal (0)
                useHex = value;
                break;
        }
        value = top = 0;
        memset(stack, 0, sizeof stack);
    } else if (c > ' ')
        showHelp();
}

void setup() {
    Serial.begin(SERIAL_BAUD);
    Serial.print("\n[RF12demo.10]");
    activityLed(0);

    if (rf12_config()) {
