Question: Does anyone know of any open source search projects written in Go?

I want to implement a simple site search for my site and am looking for a web crawler, but more specifically, a search algorithm written in Go.

Any ideas, projects, or suggestions?

Answer: 
Sorry for my prior answer. I did not completely understand the problem.

First of all, are you using an Arduino UNO, if so then check the board pin labelled digital pin 2 which is mapped as "int.0" and ensure that the interrupt line from the flowmeter is connected to this pin. (see: <http://arduino.cc/en/Reference/AttachInterrupt>).

Per Chris' comments above, the count() routine is interrupt driven code, and it appears to be coded correctly: numTicks is defined as volatile; and count() does NOT issue I/O commands such as printf; and it does NOT return any values.

The code sample that you provide does not isolate or highlight the problem. I would write a test sketch that is just a bare bones implementation of "opening" the sensor and then sensing an interrupt from the flow meter and reporting that back to the console from the main loop. If you can get code that detects one interrupt from the flow meter to work, then add more code to report on the number of interrupts in one second, then 1/2 second, etc. 

Finally, in your provided code you have the fragment:

```
    if(valve_open) {
         //    Serial.println("valve_open = true");
         inputString = "";
         stringComplete = false;
         while(numTicks <= 1000) {
            getFlow4();
         }
    }

```

Since numTicks is incremented by the interrupt routine count, as a matter of principal I would NOT test it unless some of kind of serialization was implemented. getFlow4() detaches the interrupt which is one way to serialize access to numTicks. Note. in theory code can update numTicks without serialization but any value returned is not necessarily accurate as the interrupt might have fired and increased numTicks.

It seems like your application is interested in knowing the number of ticks per second?? in which case you do NOT need to test numTicks prior to stopping the interrupts. All you might need is code that once every second checks numTicks and if you can live with dropping a count then zero out numTicks without even detaching the interrupt. However, sampling numTicks is more like polling which is what an interrupt is trying to avoid.

So, since the code is keeping track of intervals then divide the interval by numTicks to get a Hz value and don't zero out numTicks or reset the interval until they get close to rolling over.
You are never actually calling your `count()` method. You should either insert `numTicks++;` into the code where you wish to increase the count (recommended way), or call your `count()` method where you wish to increase the count. Here the `count()` method is only defined and not called, but it would make more sense to just increment the counter in the code since that is the only thing your defined method is doing.