   bool ready;
   bool claw;
   bool coin;
-} state;
+} state, previous_state;
 
 //
 // Setup

  return (initial_state == LOW)? false : true;
}

inline void pin_set (int pin, bool state) {
  if (GM_DEBUG) {
    Serial.print ("Setting pin ");

  state.motor_e = pin_init (MOTOR_E_PIN, OUTPUT, LOW);
  state.motor_w = pin_init (MOTOR_W_PIN, OUTPUT, LOW);

  previous_state = state;
  
  Wire.begin (GM_MACHINE_ADDRESS);
  Wire.onReceive (get_command);

