Skip to content

Instantly share code, notes, and snippets.

@vivekanandRdhakane
Created June 21, 2020 12:27
Show Gist options
  • Save vivekanandRdhakane/6738fbd96f04b84735d6754c36479505 to your computer and use it in GitHub Desktop.
Save vivekanandRdhakane/6738fbd96f04b84735d6754c36479505 to your computer and use it in GitHub Desktop.
void print_char(char ch, byte x_cord, byte y_cord)
{
byte ascii_to_array_index = ch - First_char_ascii_code;
int char_start_in_array = ascii_to_array_index * No_of_bytes_Char + 1;
for (byte j = x_cord; j < x_cord + Char_Horizontal_Columns_Required; j++)
{
for (byte i = y_cord; i < y_cord + Char_Verticle_Pages_Required; i++)
{
setCursor(j, i);
int array_index = char_start_in_array + (j - x_cord) * Char_Verticle_Pages_Required + (i - y_cord);
byte char_byte= pgm_read_byte(&data[array_index]);
writeData(char_byte);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment