8 column width limit on Baby O LCD printfs

Hello, I followed the wiring suggestions you made in this thread https://forum.pololu.com/t/lcd-pinout/2724/1
and wired a 16x2 LCD display (the one you sell) to my Baby O.

The device works well, but the printf’s are limited to 8 columns before wrapping, how can I modify this?

Do I need to change the 8 to a 16 in lcd_putchar, and, either change the default LCD_WIDTH (or) pass the 16 into lcd_init_printf?

I assume I cannot change just OrangutanLCD.cpp and have it take affect? I would need to recompile it into OrangutanLCD.o? Is it overboard to ask how this would be done in AVR Studio? I am successfully using your demos and recompiling and programming my Baby O, but I do not know how to recompile this lib.

Thanks for any insights!


It’s really easy to initialize printf() for use with different LCDs. Instead of calling lcd_init_printf(), which assumes a default LCD size of 8x2 when using the library version compiled for the Baby Orangutan’s MCU, you should call:

lcd_init_printf_with_dimensions(16, 2);

You can find more information in the LCD section of the AVR library command reference.

- Ben

OK that was easy, thanks. I will make sure and digest the API docs more thoroughly next time.