Problems doing bitwise operation

Hello dear forum colleagues.

I need some help because I haven’t sufficient knowledge to resolve this. I’m for 2 hours already trying to make it work and still trying, but if you can help me I’ll be very happy XD .

I have the working code:

PORTC = 0x00;
for (int i=0; i<8; i++)
  PORTC = (0x01 << i);

It runs like this:
0b00000000
0b00000001
0b00000010
0b00000100
etc…

I need that it runs this way:
0b11111111
0b11111110
0b11111101
0b11111011
etc…

Thanks,

Wagner Sartori Junior

Negate the output:

PORTC = 0x00;
for (int i=0; i<8; i++)
  PORTC = ~(0x01 << i);

Note the tilde ("~").

Hehe, it works.

lol thanks for saving I don't know how many hours of work!

This is what you help me to build. Thank you! http://www.facebook.com/video/video.php?v=208524262508402

Very impressive. :)

Very impressive.

I'll second that.

Bravo!