Hi,

I'm programming a PIC in Oshonsoft basic and having problems with > or < when it comes to, in my case a 360 degree compass bearing. I understand that this is not an Oshonsoft forum, but I am more interested in the logic.

If I explain it with a CLOCK face and a hour HAND. Hopefully it can be understood, by this explanation, but bear with my simple!!! explanation, and I have been known to make mistakes. There are 4x states, in the program.

If the HAND is pointing at 3 (HAND = 3) and I want it to go to 4 on the FACE (FACE = 4); [If HAND < FACE then move cwise] and visa versa.
If the HAND is pointing at 12 and I want it to go to 1; [If HAND < FACE then move cwise] doesn't apply.

It's this crossover point that I'm having trouble with. (HAND is counting and comparing as it moves)

1/2 way round the clock is 6, so [If HAND - FACE > 6 then move cwise] applies.

There is an added complication: I want HAND to be HAND + or - 1, so 3 includes 2 and 4.

If this is understandable, does anyone know how to solve it please?

Camerart.