     }
 
     int flashes = atoi(dataReadLn().c_str());
-    FlashLed(flashes);    
+    flashLed(flashes);    
     
     debugPrintLn("Done flashing LED.");
   }
 }
 
-bool SendButtonDown() {
-  //TODO Add detection for button on pin.
-  return false;
-}
-
-bool FlashButtonDown() {
-  //TODO Add detection for button on pin.
-  return false;
-}
-
-void FlashLed(int times) {
-  //TODO Add logic to flash led at high frequency <500ms between 
-  // flashes so we don't take too long.
+void flashLed(int times) {
+  for (int i=0; i < times; i++) {
+    digitalWrite(ledPin, HIGH);
+    delay(200);
+    digitalWrite(ledPin, LOW);
+    delay(300);
+  }
 }
 
 void debugPrintLn(const String& message) {

bool initialized = false;

void setup() {
  // Connect to pc over usb.
  Serial.begin(9600);
  

    
    debugPrintLn("Done sending random number.");
    
  } else if (digitalRead(flashButtonPin)) {
    debugPrintLn("Flashing LED.");
    dataPrintLn(String("GET# /led_flashes"));
    if (dataReadType() == '-') {
