Need some help with LED binary counter, not sure if it's hardware or software

JMA,
Techone has the essential change you need. Figure out the 4 data levels at once by using the "bitwise and" to pick off bits.
The values and therefore the single bit masks for each "digit" are powers of 2. Thus:
data4 = i & 8;
data3 = i & 4;
data2 = i & 2;
data1 = i & 1;
Then output data4 through data 1 to all 4 leds.