array of objects in Arduino vs Processing

Don’t laugh too hard when you see what I’m trying to do and how I’m doing it. ;D

I am using three 3 to 8 line decoder chips to control a 64 LED matrix that has 24 pins (this one from sparkfun):

I’ve been using books on processing to learn to write code for arduino, but I’ve run into a hitch with using an array of objects. Here is my code, based on stuff I learned in Processing. I’ve seen a number of posts suggesting that Arduino has a different way of doing this, but don’t understand them. Help very much appreciated!

Row rows = new Row[8];
Column columns = new Column[8];

int pin0=0;
int pin1=1;
int pin2=2;
int pin3=3;
int pin4=4;
int pin5=5;
int pin6=6;
int pin7=7;
int pin8=8;

void setup(){
//initialize the pins

pinMode (pin0, OUTPUT);
pinMode (pin1, OUTPUT);
pinMode (pin2, OUTPUT);
pinMode (pin3, OUTPUT);
pinMode (pin4, OUTPUT);
pinMode (pin5, OUTPUT);
pinMode (pin6, OUTPUT);
pinMode (pin7, OUTPUT);
pinMode (pin8, OUTPUT);

//initialize the array
rows[0] = new Row(LOW, LOW, LOW);
rows[1] = new Row(LOW, LOW, HIGH);
rows[2] = new Row(LOW, HIGH, LOW);
rows[3] = new Row(LOW, HIGH, HIGH);
rows[4] = new Row(HIGH, LOW, LOW);
rows[5] = new Row(HIGH, LOW, HIGH);
rows[6] = new Row(HIGH, HIGH, LOW);
rows[7] = new Row(HIGH, HIGH, HIGH);

columns[0] = new Column(LOW, LOW, LOW, HIGH, HIGH, HIGH);
columns[1] = new Column(LOW, LOW HIGH, HIGH, HIGH, LOW);
columns[2] = new Column(LOW, HIGH, LOW, HIGH, LOW, HIGH);
columns[3] = new Column(LOW, HIGH, HIGH, HIGH, LOW, LOW);
columns [4] = new Column(HIGH, LOW, LOW, LOW, HIGH, HIGH);
columns [5] = new Column(HIGH, LOW, HIGH, LOW, HIGH, LOW);
columns [6] = new Column(HIGH, HIGH, LOW, LOW, LOW, HIGH);
columns [7] = new Column(HIGH, HIGH, HIGH, LOW, LOW, LOW);

}

void loop(){
for (int i=0; i<7; i++){
columns*.lightColumn();*

  • rows[0].lightRow();*
  • delay 50;*
    }
    }

class Row {

  • boolean pin6state;*

  • boolean pin7state;*

  • boolean pin8state;*

  • Row(boolean tempPin6state, boolean tempPin7state, boolean tempPin8state) {*

  • pin6state = tempPin6state;*

  • pin7state = tempPin7state;*

  • pin8state = tempPin8state;*

  • }*

  • void lightRow(){*

  • digitalWrite(pin6, pin6state);*

  • digitalWrite(pin7, pin7state);*

  • digitalWrite (pin8, pin8state);*

  • }*
    }

class Column {

  • boolean pin3state;*

  • boolean pin4state;*

  • boolean pin5state;*

  • boolean pin0state;*

  • boolean pin1state;*

  • boolean pin2state;*

  • Column(boolean tempPin3state, boolean tempPin4state, boolean tempPin5state,*

  • boolean tempPin0state, boolean tempPin1state, boolean tempPin2state){*

  • pin3state = tempPin3state;*

  • pin4state = tempPin4state;*

  • pin5state = tempPin5state;*

  • pin0state = tempPin0state;*

  • pin1state = tempPin1state;*

  • pin2state = tempPin2state;*

  • }*

  • void lightColumn(){*

  • digitalWrite(pin3, pin3state);*

  • digitalWrite(pin4, pin4state);*

  • digitalWrite(pin5, pin5state);*

  • digitalWrite(pin0, pin0state);*

  • digitalWrite(pin1, pin1state);*

  • digitalWrite(pin2, pin2state);*

  • }*
    }
    [/quote]

I've been using books on processing to learn to write code for arduino

First mistake, sorry. Processing (Java) is for the PC, the Arduino uses C/C++.