i2c liquidcrystal & MCP23008

by skaxxo on Tue Nov 06, 2012 10:25 am

Hi

Could you help me to fix this code?
I want to print all numbers from 0 to 100 on a single row...
but it doesnt works.

any suggestions?

Code: Select all
#include "Wire.h"
#include "LiquidCrystal.h"

LiquidCrystal lcd(0);

void setup() { 
  lcd.begin(16,2);
}

void loop() {
  lcd.setCursor(16,1);
  lcd.autoscroll();
  for (int thisChar = 0; thisChar < 100; thisChar++) {
    lcd.print(thisChar);
    delay(500);
    }
  lcd.clear();
}
Arduino, MODs e DIY: blackstufflabs.com
skaxxo
 
Posts: 15
Joined: Fri May 20, 2011 10:44 am

Re: i2c liquidcrystal & MCP23008

by adafruit_support_bill on Tue Nov 06, 2012 12:06 pm

These displays have a 40x2 display buffer. You can't scroll more than 40 characters.
User avatar
adafruit_support_bill
 
Posts: 25547
Joined: Sat Feb 07, 2009 9:11 am

Re: i2c liquidcrystal & MCP23008

by skaxxo on Tue Nov 06, 2012 12:19 pm

adafruit_support wrote:These displays have a 40x2 display buffer. You can't scroll more than 40 characters.


...what do you think if i will clean the buffer evry 40 characters?
can i do that?
Arduino, MODs e DIY: blackstufflabs.com
skaxxo
 
Posts: 15
Joined: Fri May 20, 2011 10:44 am

Re: i2c liquidcrystal & MCP23008

by adafruit_support_bill on Tue Nov 06, 2012 12:42 pm

It won't be as smooth as the hardware scroll, but it should work. There is a clear() function in the library: http://www.arduino.cc/en/Reference/LiquidCrystal
User avatar
adafruit_support_bill
 
Posts: 25547
Joined: Sat Feb 07, 2009 9:11 am