Infrared coordinate counter using grid

.

Why aren't you using serial prints to tell you what is happening?

if (Direction == fhm

I pointed out in your other thread that Direction is a function pointer, and so is unlikely ever to be equal to fhm

Here,int Direction (fhm);it looks a little like you're introducing "Direction" as a function returning an "int", though I can't see the body of the function.
So, Direction by itself is a pointer to that function.
A pointer to a function and the constant 2 are unlikely ever to be equal to each other.
Some simple prints scattered around your sketch would tell you what the sketch is doing.

Edit: D'oh, sorry got my C head screwed on. Ignore me.

The usual way to initialize a variable during its declaration is something like this:

int Direction = 1;

The proper C way to initialize a variable

... but C++ has a different option.

When I said ignore me, I only meant partially, I'm serious about the prints.

As AWOL said earlier, to understand why the sketch isn't working you need to know what is happening inside it. The best way to do that is to include print statements in your code that it sends messages to the serial port.

To start with I suggest you put print statements in the code which is intended to detect line crossing, and then test it to make sure that it detects line crossings correctly.

... but C++ has a different option.

Yes, I forgot about the TWO other initialization options, () and {}. Two more ways to create confusion!

I forgot about the TWO other initialization options, () and {}

{} is valid in C too.

fhm has the value 2, not 1.
Maybe that is significant.