How to recompile a library?

Hi, I'm making a little project and for it, I'm using the LiquidCrystal Library.

It doesn't work perfect in my 20x4 screen because it swaps line 2 and 3.

Looking in the code of the library I found some values to interchange, but changing it has not effect.

I supouse that i must recompile the library but every post I've found tell to delete the .o file. The problem is that I cannot find an .o file related (at least in the name) with the LiquidCrystal library.

Any suggestions?

P.D. Thanks in advance, ;).

Which version of the Arduino IDE are you using?

The .o file is saved with your sketch. If you go into your sketch folder then it should be in a folder in there.


Arduino 0018 (the last one).

I look into my sketch folder but there is no .o file. Only my pde file.

You do not need to delete the .o file with version 0018.

Perhaps if you posted the line you are changing someone here can help

Hi again. The line that i'm trying to change is it:

  int row_offsets[] = { 0x00, 0x40, 0x14, 0x54 };

from setCursor function

void LiquidCrystal::setCursor(uint8_t col, uint8_t row)
  int row_offsets[] = { 0x00, 0x40, 0x14, 0x54 };
  if ( row > _numlines ) {
    row = _numlines-1;    // we count rows starting w/0
  command(LCD_SETDDRAMADDR | (col + row_offsets[row]));

I think that if after writing the last character of the first line it jumps to the thir one, and after finishing the third one it jumps to sencond ones, the solution must be so simple like changing the memory offset of the rows, but it doesn't work :(.

Any suggestions?

Well, after some tests, the setCursor function works fine, the problem is that there isn't a way to control when you finish a line, so, when you write the last character of the first line, it writes the next one in the next memory address, that matches the first chracter of the third line.

The only way to control it that i can imagine is to add code to the library to monitor the current position or make it manually.

Thanks for the answers!.