Hi I have an enumerator, and I want to print the names of the elements within the enumerator to my lcd.
i.e if you have
enum Enumerator{Word1, Word2, Word3};
My lcd uses this function to draw to the screen:
void draw(char* string) {
// graphic commands to redraw the complete screen should be placed here
u8g.setFont(u8g_font_unifont);
//u8g.setPrintPos(0, 20);
u8g.drawStr( 0, 22, (char *) string);
}
It works if I pass it a string that is cast to char*.
I am trying to pass it the name of a value within the enumerator however likethis:
char* chord = "";
int navigator = 0;
word= (char*) Enumerator(navigator);
draw((char*)word);
The code compiles but nothing appears on my lcd. I want (in this case) Word1 to appear on the lcd so I was wondering is there another way to grab the name of the values in an enumerator?