Data feeding problem

Hi,

I am trying to create some patterns using Row Scan multiplexing. i tried a lot to lit single led
but no success. Actually i have less knowledge of shifting bits.

This project consists of 6 RGB leds with common Anode and anode connected with BC327 PNP transistors. Circuit diagram is attached.

In this code simple i want to glow RED led ( one pin low)by using pattern and mask, so i can learn mask and pattern things.

const int row[3] = {2,4,7};   // Arduino row pins
const int column[6] = {11,10,9,6,5,3};   // Arduino column pins

int pattern = B0000001;
int mask = 1;
void setup() 
{

DDRD  |= B11111100; //set pins 2-7 to OUTPUT
PORTD |= B10010100; //set pins 2, 4, 7 HIGH   
DDRB  |= B00001110; //set pins 9-11 to OUTPUT

for(int i=0 ; i<6; i++){

   if((pattern & 1) == 1) digitalWrite(column[i], LOW); else digitalWrite(column[i], HIGH);
mask = mask << 1;
   }

digitalWrite(row[0], LOW); // turn on the LEDs

}
void loop() 
{
 
  }

Thanks in Advance.

RGB Proteus11.png

Beats me; I have difficulty following your code but for a start, you have three rows defined in your code and four in the schematic.

I presume your battery ground is the same as the Arduino ground.

Paul__B:
Beats me; I have difficulty following your code but for a start, you have three rows defined in your code and four in the schematic.

I presume your battery ground is the same as the Arduino ground.

Yes, in schematic 8 leds are used but now i want to use only 6 RGB Leds, Last row i discarded.

Ground is same.