   (void) env;
   int pin = integer(first(args));
   object *mode = second(args);
-  digitalWrite(pin, (mode != nil));
+  if (numberp(mode)) digitalWrite(pin, mode->integer);
+  else digitalWrite(pin, (mode != nil));
   return mode;
 }
 

  }
  if (listp(function) && issymbol(car(function), LAMBDA)) {
    function = cdr(function);
    object *result = closure(NULL, NULL, function, args, env);
    return eval(result, *env);
  }
  if (listp(function) && issymbol(car(function), CLOSURE)) {
    function = cdr(function);
    object *result = closure(NULL, car(function), cdr(function), args, env);
    return eval(result, *env);
  }
  error2(function, PSTR("is an illegal function"));

  return number(millis());
}

object *fn_sleep (object *args, object *env) {
  (void) env;
  object *arg1 = first(args);
  sleep(integer(arg1));
  return arg1;
}

