+#include <limits.h>  // For ULONG_MAX
+
 static const int VCCPin = 8;
 static const int analogPin = 0;
 static const float Re = 50.3; // kOhm

unsigned long t;
boolean level = LOW;
unsigned long nowt;
static int microwait = 500;

void setup() {
  Serial.begin(19200);

void loop() {

  nowt = micros();
  if (nowt >= t) {
     deltat = nowt - t;
  } else {
     // Taking care of micros overflow that should happen every 70 minutes or so
     deltat = ULONG_MAX - t + nowt;
  }
  if (deltat > microwait) {
     digitalWrite(VCCPin, level);
     if (level == HIGH) {
          if (count == 200) {
