The word and BitRead loop

Hi,
i'm trying to build a modified version of this plotter http://www.instructables.com/id/Cheap-Arduino-Controlled-3-Axis-Pen-Plotter/
The idea is to replace the X and Y axis with the hand and to move line by line. It's a kind of game, like a hard to use printer you have to learn to use (like you learn to play the piano you could learn to handprint). You move the motor with your hand, in a line after the first line is printed a LED blinks and you go to the next line.
Here is the prototype :

Before I show you the code a quick explanation, the motor doesn't seems to read the datas (it always repeat the same sequence)
I think the problem comes from bitRead and word image[].
So here is the code :

#include <Servo.h> 

Servo myservo; 
int led = 13; 
int deg;


word image[12] = {
0b001001011110,
0b001001010010,
0b001111011110,
0b001001010010
};

void setup() 
{ 

  myservo.attach(9);  
  pinMode(led, OUTPUT);  
  // here i do a big motion to know that everything is ok 
 myservo.write(0);
 delay(1000);
 myservo.write(179);
  delay(1000);
  // This far everything is working nicely
   digitalWrite(led, HIGH);
     delay(5000);
     // One LED goes bright to tell me I have 5 sec before the drawing begins
   } 

void loop() 
{ 
  deg = map(deg, 0, 1023, 0, 179); 

  for(int column = 0; column < 4; column++) {
   digitalWrite(led, LOW); 
    for(int row = 0; row < 12; row++){

      boolean pixel = bitRead(image[row],column);

      if(pixel == 1){

        penDown();
 delay(15);
      }
      else{

        penUp();
 delay(15);

      }
     
 delay(15);
    }
   


  }
  // the led goes bright again to tell me that I need to jump to another line 
  // like the enter key on a writting machine except that I do it manually
 digitalWrite(led, HIGH);
  delay(1500); 

}



void penUp() 
{
  deg=169;
  myservo.write(deg);  
  delay(30);

}
void penDown() 
{
  deg=159;
  myservo.write(deg);  
  delay(30);

}

For the moment I resolved the problem using a massive amount of penUp() penDown() (the function that make the motor goes up or down) and digitalWrite(led, LOW); digitalWrite(led, HIGH); delay() to make the led goes bright after each lines (and delay to give me enough time to go to the newt line). This works (its quite hard to write but the code do the job) but its really long to make any change and quite a boring (not smart) piece of code :

#include <Servo.h> 

Servo myservo;  
int led = 13; 
int deg;



void setup() 
{ 

  myservo.attach(9); 
  pinMode(led, OUTPUT);  
 myservo.write(0);
 delay(1000);
 myservo.write(179);
  delay(1000);
   digitalWrite(led, HIGH);
     delay(5000);
} 

void loop() 
{ 
  deg = map(deg, 0, 1023, 0, 179); 
   digitalWrite(led, LOW); 
   delay(3000);
    digitalWrite(led, HIGH);
  delay(3000);
  penDown();
  penDown();
  delay(15);
  penUp() ;
  penUp() ;
  penDown();
  penUp() ;
  penDown();
  penDown();
  penDown();
  penDown();
  penUp() ;
  penDown();
  penUp() ;
  penUp() ;
  penDown();
  penUp() ;
  penDown();
  penDown();
  penDown();
  penUp() ;
   digitalWrite(led, LOW); 
   delay(3000);
    digitalWrite(led, HIGH);
  delay(3000);

    penDown();
  penDown();
    delay(15);
  penUp() ;
  penUp() ;
  penDown();
   penUp() ;
  penDown();
    penUp() ;
  penUp() ;
  penDown();
   penUp() ;
  penDown();
   penUp() ;
    penUp() ;
  penDown();
   penUp() ;
  penDown();
   penUp() ;
  penDown();
   penDown();
   penUp() ;
  digitalWrite(led, LOW); 
   delay(3000);
    digitalWrite(led, HIGH);
  delay(3000);
    penDown();
  penDown();
    delay(15);
  penDown();
  penDown();
  penDown();
  penUp()  ;
  penDown();
  penDown();
  penDown();
  penDown();
  penUp()  ;
  penDown();
  penDown();
  penUp()  ;
  penDown();
  penUp()  ;
  penDown();
  penUp()  ;
  penDown();
  penDown();
  penUp()  ;
  digitalWrite(led, LOW); 
   delay(3000);
    digitalWrite(led, HIGH);
  delay(3000);
   penDown();
   penDown();
     delay(15);
   penUp()  ;
   penUp()  ;
   penDown();
   penUp()  ;
   penDown();
   penUp()  ;
   penUp()  ;
   penDown();
   penUp()  ;
   penDown();
   penUp()  ;
   penDown();
   penDown();
   penUp()  ;
   penDown();
   penDown();
   penDown();
   penUp()  ;

   delay(50);
      digitalWrite(led, LOW); 
   delay(50);
     digitalWrite(led, HIGH); 
   delay(50);
   digitalWrite(led, LOW); 
   delay(50);
     digitalWrite(led, HIGH); 
   delay(50);
   digitalWrite(led, LOW); 
   delay(50);
     digitalWrite(led, HIGH); 
   delay(5000);
     digitalWrite(led, HIGH); 
   delay(50);
   digitalWrite(led, LOW); 
   delay(50);
     digitalWrite(led, HIGH); 
   delay(50);
   digitalWrite(led, LOW); 
   delay(50);
     digitalWrite(led, HIGH); 
   delay(50);
   digitalWrite(led, LOW); 
   delay(50);
}


void penUp() 
{
  deg=169;
  myservo.write(deg);  
  delay(14);

}
void penDown() 
{
  deg=159;
  myservo.write(deg);  
  delay(14);

}

So the idea is to use the word word image[12] technique instead of that. If you have any idea why the first code don't work you're welcome.
Thanks

ps : I use the arduino Uno but I don't think that's relevant for the problem

Why not add some serial debug prints to find out why the code doesn't meet your expectations?

"word" is an unusual data type, and little used outside of Microsoft.
"uint16" might be more appropriate.

The type, word, is a Microslop bastard. Do not use it. Use the correct type.

The 12 in the declaration means that there are to be 12 elements in the array, not 4 elements with 12 bits.

image[row]

You don't have 12 rows.

You don't have 12 rows

Well, you do, but eight of them are zero

Thanks for the replies, I'll try right now to add prints in.
The uint 16 doesn't seems to be in the reference. The main problem with integers is that it will be a linear code. I'd like to have something easier to change like in the plotter example.

word image[16] = {
  0b0000001110000000,
  0b0010011111000100,
  0b0010001110000100,
  0b0010000100000100,
  0b0011111111111100,
  0b0000011111000000,
  0b0000011111000000,
  0b0000001110000000,
  0b0000011111000000,
  0b0000011111000000,
  0b0000110001100000,
  0b0001100000110000,
  0b0001100000110000,
  0b0011100000111000,
  0b0011100000111000,
  0b1111111111111111
};

This will draw a little character in the example ( here
their is word image[16] and they are 18 rows minus "0b "
my code is a H and A for the moment, you may be able to see them drawing themselves between the zeros

word image[12] = {
0b001001011110,
0b001001010010,
0b001111011110,
0b001001010010
};

The uint 16 doesn't seems to be in the reference.

Lots of stuff not on the reference page. A uint16_t is a 16 bit unsigned int with a defined size that all compilers must respect. An unsigned in on the Arduino is 16 bits, so is completely interchangeable.

The main problem with integers is that it will be a linear code.

Well, then, you'll have the same problem with words.

The main problem with integers is that it will be a linear code.

I'm having problems with those words - I have no idea what that means.

I tried instead

int image[12] = {
0b001001011110,
0b001001010010,
0b001111011110,
0b001001010010
};

doesn't seems to change anything, maybe the array is readable as int or word datatype ?

See reply #3

Ho thanks sorry I was confuse thanks i'm gonna try this.
Thanks for your time I'll tell you if it works.

for(int column = 0; column < 4; column++) {
   digitalWrite(led, LOW); 
    for(int row = 0; row < 12; row++){
      boolean pixel = bitRead(image[row],column);
      if(pixel == 1){ 
   .. do some penUp stuff
     } else {
   .. do some penDOwn stuff
    }
  }
}

That will "output" 4 bits, specifically the rightmost 4 bits, of your 12 rows, where there only is non-zero data in the 1st 4 of image.

You may have mixed up your row and columns - with that data (your original post) row should to go from 0 to 3, and column to go from 0 to 15

Ok its seems to work thanks a lot everybody.
I now need to calibrate the all thing to make it less hard to print, then to learn to use it. If I do a good print i'll send it here.
thanks