![]()
const uint8_t fontWidth = 8;
const PROGMEM uint8_t font[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x5f,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x03,0x00,0x03,0x00,0x00,0x00,0x00,
0x0a,0x1f,0x0a,0x1f,0x0a,0x00,0x00,0x00,
0x24,0x2a,0x2a,0x7f,0x2a,0x2a,0x12,0x00,
0x00,0x47,0x25,0x17,0x08,0x74,0x52,0x71,
0x00,0x36,0x49,0x49,0x49,0x41,0x41,0x38,
0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x3e,0x41,0x00,0x00,0x00,0x00,0x00,
0x41,0x3e,0x00,0x00,0x00,0x00,0x00,0x00,
0x04,0x15,0x0e,0x15,0x04,0x00,0x00,0x00,
0x08,0x08,0x3e,0x08,0x08,0x00,0x00,0x00,
0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,
0x08,0x08,0x08,0x08,0x08,0x00,0x00,0x00,
0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x40,0x20,0x10,0x08,0x04,0x02,0x01,0x00,
0x00,0x3e,0x61,0x51,0x49,0x45,0x43,0x3e,
0x01,0x01,0x7e,0x00,0x00,0x00,0x00,0x00,
0x00,0x71,0x49,0x49,0x49,0x49,0x49,0x46,
0x41,0x49,0x49,0x49,0x49,0x49,0x36,0x00,
0x00,0x0f,0x10,0x10,0x10,0x10,0x10,0x7f,
0x00,0x4f,0x49,0x49,0x49,0x49,0x49,0x31,
0x00,0x3e,0x49,0x49,0x49,0x49,0x49,0x30,
0x01,0x01,0x01,0x01,0x01,0x01,0x7e,0x00,
0x00,0x36,0x49,0x49,0x49,0x49,0x49,0x36,
0x00,0x06,0x49,0x49,0x49,0x49,0x49,0x3e,
0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x40,0x34,0x00,0x00,0x00,0x00,0x00,0x00,
0x08,0x14,0x22,0x00,0x00,0x00,0x00,0x00,
0x14,0x14,0x14,0x14,0x14,0x00,0x00,0x00,
0x22,0x14,0x08,0x00,0x00,0x00,0x00,0x00,
0x00,0x06,0x01,0x01,0x59,0x09,0x09,0x06,
0x00,0x3e,0x41,0x5d,0x55,0x5d,0x51,0x5e,
0x00,0x7e,0x01,0x09,0x09,0x09,0x09,0x7e,
0x00,0x7f,0x41,0x49,0x49,0x49,0x49,0x36,
0x00,0x3e,0x41,0x41,0x41,0x41,0x41,0x22,
0x00,0x7f,0x41,0x41,0x41,0x41,0x41,0x3e,
0x00,0x3e,0x49,0x49,0x49,0x49,0x49,0x41,
0x00,0x7e,0x09,0x09,0x09,0x09,0x09,0x01,
0x00,0x3e,0x41,0x49,0x49,0x49,0x49,0x79,
0x00,0x7f,0x08,0x08,0x08,0x08,0x08,0x7f,
0x00,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x38,0x40,0x40,0x41,0x41,0x41,0x3f,
0x00,0x7f,0x08,0x08,0x08,0x0c,0x0a,0x71,
0x00,0x3f,0x40,0x40,0x40,0x40,0x40,0x40,
0x00,0x7e,0x01,0x01,0x7e,0x01,0x01,0x7e,
0x00,0x7e,0x01,0x01,0x3e,0x40,0x40,0x3f,
0x00,0x3e,0x41,0x41,0x41,0x41,0x41,0x3e,
0x00,0x7e,0x09,0x09,0x09,0x09,0x09,0x06,
0x00,0x3e,0x41,0x41,0x71,0x51,0x51,0x7e,
0x00,0x7e,0x01,0x31,0x49,0x49,0x49,0x46,
0x00,0x46,0x49,0x49,0x49,0x49,0x49,0x31,
0x01,0x01,0x01,0x7f,0x01,0x01,0x01,0x00,
0x00,0x3f,0x40,0x40,0x40,0x40,0x40,0x3f,
0x00,0x0f,0x10,0x20,0x40,0x20,0x10,0x0f,
0x00,0x3f,0x40,0x40,0x3f,0x40,0x40,0x3f,
0x00,0x63,0x14,0x08,0x08,0x08,0x14,0x63,
0x00,0x07,0x08,0x08,0x78,0x08,0x08,0x07,
0x00,0x71,0x49,0x49,0x49,0x49,0x49,0x47,
0x00,0x7f,0x41,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x41,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x7e,0x01,0x09,0x09,0x09,0x09,0x7e,
0x00,0x7f,0x41,0x49,0x49,0x49,0x49,0x36,
0x00,0x3e,0x41,0x41,0x41,0x41,0x41,0x22,
0x00,0x7f,0x41,0x41,0x41,0x41,0x41,0x3e,
0x00,0x3e,0x49,0x49,0x49,0x49,0x49,0x41,
0x00,0x7e,0x09,0x09,0x09,0x09,0x09,0x01,
0x00,0x3e,0x41,0x49,0x49,0x49,0x49,0x79,
0x00,0x7f,0x08,0x08,0x08,0x08,0x08,0x7f,
0x00,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x38,0x40,0x40,0x41,0x41,0x41,0x3f,
0x00,0x7f,0x08,0x08,0x08,0x0c,0x0a,0x71,
0x00,0x3f,0x40,0x40,0x40,0x40,0x40,0x40,
0x00,0x7e,0x01,0x01,0x7e,0x01,0x01,0x7e,
0x00,0x7e,0x01,0x01,0x3e,0x40,0x40,0x3f,
0x00,0x3e,0x41,0x41,0x41,0x41,0x41,0x3e,
0x00,0x7e,0x09,0x09,0x09,0x09,0x09,0x06,
0x00,0x3e,0x41,0x41,0x71,0x51,0x51,0x7e,
0x00,0x7e,0x01,0x31,0x49,0x49,0x49,0x46,
0x00,0x46,0x49,0x49,0x49,0x49,0x49,0x31,
0x01,0x01,0x01,0x7f,0x01,0x01,0x01,0x00,
0x00,0x3f,0x40,0x40,0x40,0x40,0x40,0x3f,
0x00,0x0f,0x10,0x20,0x40,0x20,0x10,0x0f,
0x00,0x3f,0x40,0x40,0x3f,0x40,0x40,0x3f,
0x00,0x63,0x14,0x08,0x08,0x08,0x14,0x63,
0x00,0x07,0x08,0x08,0x78,0x08,0x08,0x07,
0x00,0x71,0x49,0x49,0x49,0x49,0x49,0x47,
0x08,0x36,0x41,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x41,0x36,0x08,0x00,0x00,0x00,0x00,0x00,
0x02,0x01,0x01,0x02,0x02,0x01,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
char topWord[] = " HELLO ";
char bottomWord[] = "YouTube";
void setup() {
DDRD = B11111111;
}
void loop() {
MultiChar();
}
void MultiChar()
{
int horizUnit = 90;
PORTD = 250;
for (uint8_t i = 0; i < sizeof(topWord) - 1; i++)
{
for (uint8_t x = 0; x < fontWidth; x++)
{
for (uint8_t r = 0; r < 2; r++)
{
int ch = ((r == 0) ? bottomWord[i] : topWord[i]) - ' ';
uint8_t rowOffset = 80 * r;
uint8_t bitAnalogValue = 40 + rowOffset;
unsigned char vertByte = pgm_read_byte_near(font + ch*8 + x);
for (uint8_t y = 0; y <= 7; y++)
{
bitAnalogValue += 7;
if (bitRead(vertByte, 7 - y)) PORTD = bitAnalogValue;
delayMicroseconds(horizUnit);
}
}
}
PORTD = 0; delayMicroseconds(500);
}
delay(20);
}
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.