Hi Guys and Girls,

I’m having a bit of a issue with some code I’m playing with, I am not a expert with c++ so maybe it’s something obvious, but I didn’t know which ‘keywords’ to be using for a google search. Any ways to the point, my codes a tad long so I am just posting the believed culprit of one of three problems I’m having:

```
//Part of earlier code like defines and stuff//
#include <ht1632c.h>
#include <FHT.h>
#define LOG_OUT 1
#define FHT_N 64
ht1632c dotmatrix = ht1632c(PORTD, 7, 6, 4, 5, GEOM_32x16, 2);
countX = 0;
countY = 0;
//For Loop where code is messing up//
void loop() {
while(1) {
cli();
for (int i = 0 ; i < FHT_N ; i++) {
if ( (i & 0x01) == 0 ){countX++; if(countX >= 31){countX = 0;} }
//^^ Here is where it's screwing up, It counts up every even number because there are 64 Fht and the odds are either duplicates or
// zero
while(!(ADCSRA & 0x10));
ADCSRA = 0xf5;
byte m = ADCL;
byte j = ADCH;
int k = (j << 8) | m;
k -= 0x0200;
k <<= 6;
fht_input[i] = k;
}
...............
}
```

Now the problem is the counting, it goes to up to 30 and goes to zero, I have tried replacing the

```
if(countX >= 31){countX = 0;} }
```

with

```
if(countX >= 32){countX = 0;} }
```

and

```
if(countX > 31){countX = 0;} }
```

but when I do that the counter either doesn’t reset or doesn’t count at all. Any help?