 {
     // wait until clock is low
     while (digitalRead(PIN_CLOCK) != LOW);
+
+    // indicate activity on LED
+    digitalWrite(PIN_LED, HIGH);
     
     // sample data and process in the ZG01 state machine
     uint8_t data = (digitalRead(PIN_DATA) == HIGH) ? 1 : 0;


#define PIN_CLOCK   2
#define PIN_DATA    3

static uint8_t buffer[5];



    // wait until clock is high again
    while (digitalRead(PIN_CLOCK) == LOW);    

    // indicate activity on LED
    digitalWrite(PIN_LED, LOW);
}


