Cannot read signal from flow meter

robtillaart:
An Arduino sketch to read a KWH meter I made once can also be used here, you need to adapt some constants.

thanks for the input robtillaart! I'm confused about the pin 2 of the Arduino board, because I'm using Mega 1280 model and Pin 2 is located on the "Analog In" sector. The "digital" inputs are from pin 22 to pin 53.