To select a single LED in a row of eight.....
10000000 = 128... bit 7
01000000 = 64 .... bit 6
00100000 = 32 .... bit 5
00010000 = 16 .... bit 4
00001000 = 8 ...... bit 3
00000100 = 4 ...... bit 2
00000010 = 2 ...... bit 1
00000001 = 1 ...... bit 0
if I want to manipulate bit 3 I can AND ,OR and XOR with...
10000000 = 128... bit 7
01000000 = 64 .... bit 6
00100000 = 32 .... bit 5
00010000 = 16 .... bit 4
00001000 = 8 ...... bit 3
00000100 = 4 ...... bit 2
00000010 = 2 ...... bit 1
00000001 = 1 ...... bit 0
if I want to manipulate bit 3 I can AND ,OR and XOR with...
C:
//... lets assume backbuffer location = 0xff.
mask = backbuffer[location]; // .... get the state of the row of LED's
x = pow[3]; //... x now equals 8
mask ^= x; // XOR 0xff with 0x08;
mask |= x; // OR 0xff with 0x08;