Too Much Too Soon
Posted in Hobbies
First dog watch, 2 bells (5:08 pm)

I decided on a whim this morning (since my foot was feeling real good) that I would attend the Ingress Recursion Event in downtown Spokane. I knew there would be some walking but felt up to it. Aaaaaand I overdid it. I had to cut short my time since I had to be in Coeur d'Alene by 4pm, but even so it was too much. My feet are killing me. This was the most time walking and generally being on my feet since my Achilles tendon surgery. I hope I can walk tomorrow…

I did get a patch and a virtual badge, though. I also used up at least a third of my inventory. Which means I have room for more stuff later.

Update: I really did overdo it. I just endured a solid five-minute charley horse in my calf. My leg just would not relax.

Leave a Comment »
Arduino Ingress Hack Timer
Posted in Code, Hobbies, Tech
Forenoon watch, 7 bells (11:58 am)

I've been enjoying playing Ingress lately, but found myself in need of a 5-minute cool-down timer whilst hacking portals. Not wanting to exit the app and launch a separate timer on my Nexus 4, I went to my Arduino for an answer and came up with this solution: a 5-minute timer with a bare Arduino.

That's it, no extra parts necessary.

Using the Arduino's built-in LED on pin 13, After 3 minutes I start turning the LED off and on about once per second. At 4 minutes the blinking speeds up. At 4:30 it speeds up again. At 5 minutes the LED is on steady. Hit the reset button when you hack the portal and start over!

Plug the Arduino in and compile/upload the following code:

const int ledPin = 13;
int ledState = LOW;

unsigned long lastBlink = 0;

void toggleLEDState() {
  if(ledState == LOW) {
    ledState = HIGH;
  } else {
    ledState = LOW;
  }
}

void setup() {
  pinMode(ledPin, OUTPUT);
}

void loop() {
  unsigned long nowMillis = millis();
  
  if(nowMillis > 300000) {
    ledState = HIGH;
  } else if(nowMillis > 270000) {
    if(nowMillis - lastBlink > 200) {
      toggleLEDState();
      lastBlink = nowMillis;
    }
  } else if(nowMillis > 240000) {
    if(nowMillis - lastBlink > 500) {
      toggleLEDState();
      lastBlink = nowMillis;
    }
  } else if(nowMillis > 180000) {
    if(nowMillis - lastBlink > 1000) {
      toggleLEDState();
      lastBlink = nowMillis;
    }
  }
  
  digitalWrite(ledPin, ledState);
}
Leave a Comment »