   }
 }
 
-
-
+int freeRam () {
+  extern int __heap_start, *__brkval;
+  int v;
+  return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);
+}
+

boolean systemReseted() {
  // with EMI, be very sure.
  Metro readTime(DEBOUNCE_TIME);
  readTime.reset();
  while( !readTime.check() ) systemReset.update();

  // at system power up, relay is open, meaning pin will read HIGH.

// alternative to delay(), non-blocking
void myDelay(unsigned long delayTime) {
  Metro delayFor(delayTime);
  delayFor.interval(delayTime);
  delayFor.reset();

  while( ! delayFor.check() ) {
    // insert any mission-critical operations here
