Show Posts
Pages: [1]
1  Using Arduino / Displays / Re: [SOLVED] How to createChar with items inside an array on: November 23, 2012, 10:03:56 pm
Solved.

Thanks
2  Using Arduino / Displays / [SOLVED] How to createChar with items inside an array on: November 23, 2012, 08:47:04 pm
Please, i've looked around the forum but no found solution to my problem, someone can help me to create the character with items inside an array.

"a" is 1 to 16 and I want to build a character (5x8) within the array "alines" in position "a" to "+7".

thank you

Code:


#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 9, 8, 7, 6, 5, 4, 3, 2);
byte alines[ ] = {
  B10000, B11000, B10100, B10010, B10001, B10000,
  B11000, B11111, B11010, B11001, B11000, B11000,
  B11100, B11010, B11001, B11111, B11111, B11101,
  B11100, B11100, B11100, B11110, B11101,};
long a = 0;
void setup()
{
  lcd.begin(16, 2);
}
void loop()
{
  lcd.createChar(1, a to a +7); /// NEED CREATECHEAR with 8 BYTEs of "alines" from A to A + 7
  lcd.setCursor(0, 0);
  lcd.write(1);
  delay(300);
  a = a + 1;
  if ( a > 17 ) { a = 1 ;}
}


Pages: [1]