/*
serLCD - Create custom character example 2
This example creates 8 custom characters
resulting in a bar graph.
*/
#include <NewSoftSerial.h>
#include <serLCD.h>
// Set pin to the LCD's rxPin
int pin = 2;
serLCD lcd(pin);
byte bars[8][8] = {
{B00000,B00000,B00000,B00000,B00000,B00000,B00000,B11111},
{B00000,B00000,B00000,B00000,B00000,B00000,B11111,B11111},
{B00000,B00000,B00000,B00000,B00000,B11111,B11111,B11111},
{B00000,B00000,B00000,B00000,B11111,B11111,B11111,B11111},
{B00000,B00000,B00000,B11111,B11111,B11111,B11111,B11111},
{B00000,B00000,B11111,B11111,B11111,B11111,B11111,B11111},
{B00000,B11111,B11111,B11111,B11111,B11111,B11111,B11111},
{B11111,B11111,B11111,B11111,B11111,B11111,B11111,B11111}
};
void setup()
{
for (int i=1; i < 9; i++){
lcd.createChar(i, bars[i-1]);
}
}
void loop()
{
for (int i=1; i < 9; i++){
lcd.printCustomChar(i);
}
while(1); // stop looping
}