Lets take it from the beginning. If you shift an 8bit 8 times you get 0 no matter the starting value.
0b1111-1111 <Starting value
0b0111-1111 <Result of 1 shift
0b0011-1111 <Result of 2 shift
0b0001-1111 <Result of 3 shift
0b0000-1111 <Result of 4 shift
0b0000-0111 <Result of 5 shift
0b0000-0011 <Result of 6 shift
0b0000-0001 <Result of 7 shift
0b0000-0000 <Result of 8 shift
--------------
This is your code
for (count = 0; count < 8; count++) {
DATA = (bits >> count); // output = number shifted right * count
PORTC = DATA;
if( DATA & compare){
//output
}
Delay_ms(1000);
}
Everything inside for (Red) will be executed 8 times.
So you will make the shift, compare, output, delay 8 times, in 1 second interval and then again from the start. Is this what you want?
It works because first shift is >>0 and you actually are doing 7 shifts.
Lets examine shifts for 100= 0b0110-0100:
Loop #1: DATA = (bits >> 0); = bits (true)
Loop #2: DATA = (bits >> 1); = 0b0011-0010 (false)
Loop #3: DATA = (bits >> 2); = 0b0001-1001 (true)
Loop #4: DATA = (bits >> 3); = 0b0000-1100 (false)
Loop #5: DATA = (bits >> 4); = 0b0000-0110 (false)
Loop #6: DATA = (bits >> 5); = 0b0000-0011 (true)
Loop #7: DATA = (bits >> 6); = 0b0000-0001 (true)
Loop #8: DATA = (bits >> 7); = 0b0000-0000 (false)
Your mask is 0x00-00-00-01 its the same with 0x01 for this code. = 0b0000-0001
AND & logic
0bxxxx-xxxx Your number
0b0000-0001 Your mask
--------------------
0b0000-000x Result
if result ==0 >false, if result!=0 >true
So your mask checks only the Least Significant Digit (LSD)
if the LSD is 1 the result is true, if the LSD is 0 the result is false. Above I marked the result of the "if" on every loop for basic number 100.
If you want to Most Significant Digit (MSD) then your mask will be 0x80 (0b1000-0000)
If you don't see activity on a pin try different one, maybe its burned or a peripheral may have the control of it.