Hi guys,
I just found a glitch in the lcd functions.
My robot code basically does:
void load_custom_characters()
{
OrangutanLCD::loadCustomCharacter(levels+0,0); // no offset, e.g. one bar
OrangutanLCD::loadCustomCharacter(levels+1,1); // two bars
OrangutanLCD::loadCustomCharacter(levels+2,2); // etc...
OrangutanLCD::loadCustomCharacter(levels+3,3);
OrangutanLCD::loadCustomCharacter(levels+4,4);
OrangutanLCD::loadCustomCharacter(levels+5,5);
OrangutanLCD::loadCustomCharacter(levels+6,6);
lcd.clear(); // the LCD must be cleared for the characters to take effect
}
then to print the display bar chart:
display_readings(const unsigned int *calibrated_values)
the problem is then when I print some values from my algorithms lets say:
simple.a=100;
lcd.gotoXY(0,0);
OrangutanLCD::print("Min:");
lcd.gotoXY(4,0);
OrangutanLCD::print(simple.a);
I get random chars popping up.
How can I unload the custom characters from the EEPROM?
Should I put to to zero the custom characters in the prog mem space?
const PROGMEM char levels[]= {
0b00000,
0b00000,
0b00000,
0b00000,
0b00000,
0b00000,
0b00000,
0b11111,
0b11111,
0b11111,
0b11111,
0b11111,
0b11111,
0b11111
};
UPDATES:
I probably found where the error is, I’m doing a simple test program and uploading so others can try to reproduce the bug I’m having.
Cheers.