질문게시판 > OLED에 큰 폰트를 사용하여 숫자 나타내기

TODAY378 TOTAL2,175,686
사이트 이용안내
Login▼/회원가입
최신글보기 질문게시판 기술자료 동영상강좌

아두이노 센서 ATMEGA128 PWM LED 초음파 AVR 블루투스 LCD UART 모터 적외선


BASIC4MCU | 질문게시판 | OLED에 큰 폰트를 사용하여 숫자 나타내기

페이지 정보

작성자 kindrightL 작성일2020-11-02 13:54 조회2,874회 댓글1건

본문

	

안녕하세요

저는 지금 OLED SSD1306에 32x48사이즈로 폰트를 나타내려고 하는데요

5x8폰트는 잘 나오는데 32x48같이 큰 사이즈 폰트를 사용하려 하니 원리를 잘 이해하지 못했는지 잘 진행이 되지 않습니다ㅠㅠ

 

이것은 main.c이구요

#include <stdarg.h>

#include <stdio.h>

#include <string.h>

#include <stdlib.h>

#include <util/delay.h>

#include "spi.h"

 

typedef int bool;

enum

{

    false,

    true

};

 

/*============================================================================*/

#define PORTB_REG   0x23

struct port

{

    uint8_t   pin;

    uint8_t   ddr;

    uint8_t   port;

};

volatile struct port *const portb = (void*)PORTB_REG;

 

#define SCK     0x20

#define MISO    0x10

#define MOSI    0x08

#define CS      0x04

#define DC      0x02

#define RST     0x01

 

/*============================================================================*/

static inline void cs_high(void)

{

    portb->port |= CS;

}

 

static inline void cs_low(void)

{

    portb->port &= ~CS;

}

 

static inline void dc_high(void)

{

    portb->port |= DC;

}

 

static inline void dc_low(void)

{

    portb->port &= ~DC;

}

 

static inline void rst_high(void)

{

    portb->port |= RST;

}

 

static inline void rst_low(void)

{

    portb->port &= ~RST;

}

 

/*============================================================================*/

static void port_init(void)

{

    portb->ddr  = (SCK | MOSI | CS | DC | RST);

    portb->port = (CS | DC | RST);

}

 

/*============================================================================*/

/* Fundamental Command */

#define SSD1306_CMD_ENTIRE_ON           0xA4

#define SSD1306_CMD_DISPLAY_ON          0xAE

 

/* Addressing Setting Command */

#define SSD1306_CMD_ADDR_MODE           0x20

#define SSD1306_CMD_COL_ADDR            0x21

#define SSD1306_CMD_ROW_ADDR            0x22

enum

{

    HORIZONTAL,

    VERTICAL,

    PAGE

};

 

#define SSD1306_CMD_COL_LO_ADDR         0x00

#define SSD1306_CMD_COL_HI_ADDR         0x10

#define SSD1306_CMD_PAGE_START_ADDR     0xB0

 

/* Charge Pump Command */

#define SSD1306_CMD_CHARGEPUMP          0x8D

 

/*============================================================================*/

void ssd1306_reset(void)

{

    rst_low();

    _delay_ms(1);

    rst_high();

}

 

void ssd1306_cmd(uint8_t *cmd, uint8_t len)

{

    int     i;

 

    dc_low();

    cs_low();

 

    for (i=0; i<len; i++)

        spi_rw(*cmd++);

 

    cs_high();

}

 

void ssd1306_data(uint8_t *data, uint16_t len)

{

    int     i;

 

    dc_high();

    cs_low();

 

    for (i=0; i<len; i++)

        spi_rw(*data++);

 

    cs_high();

}

 

/*============================================================================*/

static void ssd1306_chargepump_enable(bool enable)

{

    uint8_t     cmd_buf[2];

 

    cmd_buf[0] = SSD1306_CMD_CHARGEPUMP;

    cmd_buf[1] = 0x10 | (enable ? 4 : 0);

 

    ssd1306_cmd(cmd_buf, 2);

}

 

static void ssd1306_entire_on(bool enable)

{

    uint8_t     cmd = SSD1306_CMD_ENTIRE_ON | enable;

 

    ssd1306_cmd(&cmd, 1);

}

 

static void ssd1306_display_on(bool enable)

{

    uint8_t     cmd = SSD1306_CMD_DISPLAY_ON | enable;

 

    ssd1306_cmd(&cmd, 1);

}

 

static void ssd1306_set_addr_mode(uint8_t mode)

{

    uint8_t     cmd_buf[2];

 

    cmd_buf[0] = SSD1306_CMD_ADDR_MODE;

    cmd_buf[1] = mode;

 

    ssd1306_cmd(cmd_buf, 2);

}

 

static void ssd1306_set_page_start(uint8_t page)

{

    uint8_t     cmd = SSD1306_CMD_PAGE_START_ADDR | page;

 

    ssd1306_cmd(&cmd, 1);

}

 

static void ssd1306_set_column_addr(uint8_t column)

{

    uint8_t     cmd;

 

    cmd = SSD1306_CMD_COL_LO_ADDR | (column & 0xF);

    ssd1306_cmd(&cmd, 1);

 

    cmd = SSD1306_CMD_COL_HI_ADDR | ((column >> 4) & 0xF);

    ssd1306_cmd(&cmd, 1);

}

 

 

void ssd1306_init(void)

{

    _delay_ms(1);

 

    ssd1306_reset();

 

    ssd1306_chargepump_enable(true);

    ssd1306_entire_on(false);

    ssd1306_display_on(true);

}

 

/*============================================================================*/

#define PAGE_NUM        8

#define COL_NUM         128

#define CHAR_WIDTH      6

#define MAX_CH_PER_LINE 21

 

static uint8_t gddram[COL_NUM];

 

void clear_screen(void)

{

    uint8_t page;

    uint8_t col;

 

    for (col=0; col<COL_NUM; col++)

{

        gddram[col] = 0;

 

for (page=0; page<PAGE_NUM; page++)

{

ssd1306_set_page_start(page);

ssd1306_data(gddram, COL_NUM);

};

};

    ssd1306_set_column_addr(0);

}

 

extern void get_ch_data(uint8_t ch, uint8_t *buffer);

 

void setup(void)

{

    port_init();

    spi_init();

 

    ssd1306_init();

    ssd1306_set_addr_mode(PAGE);

    clear_screen();

    oled_msg(0, 0, "> Positioned Text <");

    oled_msg(2, 2, "Even :");

    oled_msg(3, 2, "Odd  :");

}

 

void loop(void)

{

    static int loop = 0;

 

    oled_msg(2, 9, "%6d", loop * 2);

    oled_msg(3, 9, "%6d", loop * 2 + 1);

    loop++;

 

    _delay_ms(1000);

}

 

int main(void)

{

    setup();

 

     int j;

     

     for(j=0; j<6; j++)

     {

get_ch_data(3, gddram);

     

ssd1306_set_page_start(j);

ssd1306_set_column_addr(0);

ssd1306_data(gddram[j*32],32);

     };

}

 

여기부터가 제가 만든 font 입니다.

#include <avr/pgmspace.h>


static const uint8_t MYFONT3248[11][192] PROGMEM =
{
{0x00,0x00,0x00,0x00,0x80,0xC0,0xE0,0xF0,0xF8,0xFC,0xFC,0x7E,0x3E,0x1F,0x1F,0x1F,0x1F,0x1F,0x3E,0x7E,0xFC,0xFC,0xF8,0xF0,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,
0x00,0xC0,0xF8,0xFE,0xFF,0xFF,0x7F,0x0F,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x0F,0x7F,0xFF,0xFF,0xFE,0xF8,0xC0,0x00,0x00,
0xFE,0xFF,0xFF,0xFF,0xFF,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xFF,0xFF,0xFF,0xFE,0x00,
0x1F,0xFF,0xFF,0xFF,0xFF,0xF8,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xF8,0xFF,0xFF,0xFF,0xFF,0x1F,0x00,
0x00,0x01,0x07,0x3F,0xFF,0xFF,0xFF,0xFC,0xF0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xF0,0xFC,0xFF,0xFF,0xFF,0x3F,0x07,0x01,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x07,0x0F,0x1F,0x1F,0x3F,0x3E,0x7C,0x7C,0x7C,0x7C,0x7C,0x3E,0x3F,0x1F,0x1F,0x0F,0x07,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00},
{0xE0,0xE0,0xE0,0xE0,0xE0,0xF0,0xF0,0xF0,0xF8,0xF8,0xFC,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x00},
{0xF0,0xF8,0xFC,0xFC,0xFC,0xFE,0x7E,0x7E,0x7E,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x7F,0xFF,0xFF,0xFE,0xFE,0xFE,0xFC,0xFC,0xF8,0xF0,0xE0,0xC0,0x00,0x00,
0x03,0x03,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x8F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xF0,0xFC,0xFF,0xFF,0xFF,0xFF,0xFF,0x3F,0x0F,0x01,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xE0,0xF0,0xF8,0xFC,0xFE,0xFF,0xFF,0x7F,0x3F,0x1F,0x0F,0x07,0x03,0x01,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x80,0xC0,0xE0,0xE0,0xF0,0xF8,0xFC,0xFE,0xFF,0xFF,0x7F,0x3F,0x1F,0x0F,0x07,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x7E,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7D,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x00},
{0x00,0xF8,0xFC,0xFC,0xFC,0xFE,0xFE,0xFE,0x7E,0x7F,0x7F,0x7F,0x3F,0x3F,0x3F,0x3F,0x7F,0x7F,0x7F,0xFE,0xFE,0xFE,0xFC,0xFC,0xF8,0xF0,0xE0,0xC0,0x80,0x00,0x00,0x00,
0x00,0x07,0x03,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x83,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0x1E,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xF0,0xF0,0xF0,0xF0,0xF8,0xF8,0xF8,0xFC,0xFC,0xDE,0x9F,0x8F,0x0F,0x07,0x03,0x01,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x03,0x03,0x07,0x1F,0x3F,0x7F,0xFE,0xFC,0xF8,0xF0,0xE0,0xC0,0x00,0x00,
0xE0,0xC0,0xC0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xF0,0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0x1F,0x00,
0x1F,0x1F,0x1F,0x3F,0x3F,0x3F,0x3F,0x7F,0x7E,0x7E,0x7E,0x7E,0x7E,0x7E,0x7E,0x7E,0x7E,0x7E,0x7F,0x7F,0x3F,0x3F,0x1F,0x1F,0x0F,0x07,0x03,0x01,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xE0,0xF0,0xF1,0xFC,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xE0,0xF0,0xF8,0xFC,0xFE,0x7F,0x3F,0x1F,0x0F,0x07,0x03,0x01,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,
0xE0,0xF0,0xF8,0xFC,0xFE,0x7F,0x3F,0x1F,0x0F,0x07,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,
0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,
0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x03,0x03,0x03,0x03,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x00,
0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3E,0x3E,0x3E,0x3E,0x3E,0x3E,0x3E,0x3E,0x3E,0x3E,0x7E,0x7E,0xFC,0xFC,0xFC,0xF8, 0xF8,0xF0,0xE0,0xC0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x07,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0xF0,0x00,
0xC0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xF0,0xFF,0xFF,0xFF,0xFF,0x7F,0x1F,0x07,0x00,
0x0F,0x1F,0x1F,0x3F,0x3F,0x7E,0x7E,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7E,0x7E,0x3F,0x3F,0x1F,0x1F,0x0F,0x07,0x03,0x01,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xE0,0xF0,0xF8,0xFC,0xFE,0x7E,0x3F,0x1F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x1F,0x1E,0x1E,0x1C,0x00,0x00,0x00,0x00,0x00,
0x00,0x80,0xF0,0xFC,0xFF,0xFF,0xFF,0x7F,0x1F,0x07,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0x78,0x3C,0x3C,0x3E,0x3E,0x3E,0x3E,0x3E,0x3E,0x3E,0x3E,0x3E,0x3E,0x3E,0x3E,0x3E,0x3C,0x7C,0xF8,0xF0,0xE0,0xC0,0x80,0x00,0x00,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,
0x00,0x07,0x3F,0x7F,0xFF,0xFF,0xF8,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xE0,0xF8,0xFF,0xFF,0x7F,0x3F,0x07,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0x03,0x07,0x0F,0x1F,0x1F,0x3F,0x3E,0x7E,0x7C,0x7C,0x7C,0x7C,0x7C,0x7E,0x3E,0x3F,0x1F,0x1F,0x0F,0x07,0x03,0x01,0x00,0x00,0x00,0x00,0x00},
{0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xF0,0xFC,0xFF,0xFF,0xFF,0x3F,0x0F,0x03,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xE0,0xF8,0xFE,0xFF,0xFF,0x7F,0x1F,0x07,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xE0,0xF8,0xFE,0xFF,0xFF,0x7F,0x1F,0x07,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xE0,0xF8,0xFE,0xFF,0xFF,0x7F,0x1F,0x07,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x40,0x70,0x7C,0x7F,0x7F,0x7F,0x7F,0x1F,0x07,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x80,0xE0,0xF8,0xF8,0xFC,0x7E,0x3E,0x3E,0x1F,0x1F,0x1F,0x0F,0x0F,0x1F,0x1F,0x1F,0x1F,0x3E,0x3E,0x7E,0xFC,0xFC,0xF8,0xF0,0xE0,0xC0,0x00,0x00,0x00,
0x00,0x7E,0xFF,0xFF,0xFF,0xFF,0xFF,0xC1,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x81,0xFF,0xFF,0xFF,0xFF,0xFF,0x3E,0x00,0x00,
0x00,0x00,0x01,0x03,0x07,0x8F,0x9F,0xDF,0xFF,0xFF,0xFE,0xFC,0xFC,0xFC,0xF8,0xF8,0xF0,0xF0,0xF0,0xF0,0xF8,0xFC,0xFE,0xBF,0x9F,0x0F,0x07,0x03,0x00,0x00,0x00,0x00,
0xC0,0xF0,0xFC,0xFE,0xFF,0xFF,0x3F,0x07,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x03,0x03,0x03,0x07,0x0F,0x0F,0x1F,0x7F,0xFF,0xFF,0xFE,0xFC,0xF0,0xC0,0x00,
0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xE0,0xFF,0xFF,0xFF,0xFF,0xFF,0x1F,0x00,
0x00,0x00,0x01,0x03,0x07,0x0F,0x1F,0x1F,0x3F,0x3E,0x3E,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x7C,0x3E,0x3E,0x3F,0x1F,0x1F,0x0F,0x07,0x03,0x01,0x00,0x00,0x00},
{0x00,0x00,0x80,0xE0,0xF0,0xF8,0xF8,0xFC,0xFE,0x7E,0x3E,0x3F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x3F,0x3E,0x7E,0xFE,0xFC,0xFC,0xF8,0xF0,0xE0,0xC0,0x00,0x00,0x00,0x00,
0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0x07,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x07,0x1F,0xFF,0xFF,0xFF,0xFF,0xFC,0xC0,0x00,
0x0F,0x7F,0xFF,0xFF,0xFF,0xFF,0xF8,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,
0x00,0x00,0x00,0x03,0x07,0x07,0x0F,0x0F,0x1F,0x1F,0x1F,0x3F,0x3E,0x3E,0x3E,0x3E,0x3E,0x3E,0x1E,0x1F,0x1F,0x0F,0x0F,0x07,0xE7,0xFF,0xFF,0xFF,0xFF,0xFF,0x07,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xE0,0xF8,0xFE,0xFF,0x7F,0x1F,0x07,0x01,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x3E,0x7E,0x7E,0x7E,0x7C,0x7C,0x7C,0x7C,0x7C,0x7E,0x3E,0x3E,0x3E,0x1F,0x1F,0x0F,0x0F,0x07,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
};
void get_ch_data(uint8_t ch, uint8_t *buffer)
{
   int i;
   
   for(i=0; i<196; i++)
*buffer++ = pgm_read_byte(MYFONT3248[ch][i]);
}

위의 코드는 3이라는 숫자를 나타내기 위해 작성해본 코드이고 제가 이해를 잘 하지 못하여 빌드를 했을 때 몇가지의 에러가 나는 상황이고
숫자가 아닌 이상한 그래픽이 디스플레이 되고 있습니다ㅠㅠ
page0에 32x8을 써넣고 다음 page로 넘어가서 다음 32x8을 써넣는 방식으로 해야할 것 같은데 코드로 어떻게 구현해야할지 모르겠습니다. 
도와주세요ㅠㅠㅠㅠㅠ

 

  • BASIC4MCU 작성글 SNS에 공유하기
  • 페이스북으로 보내기
  • 트위터로 보내기
  • 구글플러스로 보내기

댓글 1

조회수 2,874

master님의 댓글

master 작성일

https://www.hackster.io/jdmorise/big-characters-on-ssd1306-on-microchip-avr-e9e198
웹검색해서 방법을 찾아보세요
(5x8 출력을 완전히 이해하면 32x48을 출력하는 것도 어렵지 않습니다.)

질문게시판HOME > 질문게시판 목록

MCU, AVR, 아두이노 등 전자공학에 관련된 질문을 무료회원가입 후 작성해주시면 전문가가 답변해드립니다.
ATMEGA128PWMLED초음파
아두이노AVR블루투스LCD
UART모터적외선ATMEGA
전체 스위치 센서
질문게시판 목록
제목 작성자 작성일 조회
공지 MCU, AVR, 아두이노 등 전자공학에 관련된 질문은 질문게시판에서만 작성 가능합니다. 스태프 19-01-15 9698
공지 사이트 이용 안내댓글[24] master 17-10-29 29853
질문 esp32를 이용한 피에조부저댓글[1] 이미지새글 ejdog 22-05-27 13
질문 아두이노 서보모터 무한회전 문제 해결을 어떻게 해야할까요 새글 GinGer 22-05-27 16
답변 답변글 답변 : 아두이노 서보모터 무한회전 문제 해결을 어떻게 해야할까요 새글 master 22-05-27 17
질문 모터 엔코더 제어 질문드립니다. 새글 oreoreo 22-05-27 19
답변 답변글 답변 : 모터 엔코더 제어 질문드립니다. 새글 master 22-05-27 14
질문 아두이노 RF무선통신 관련 질문입니다.댓글[2] 새글 메론맛드링크 22-05-27 19
질문 아두이노 속도측정, 속도를 LCD에 표시, 가까워지면 부저 새글 wgtjdwls 22-05-27 20
답변 답변글 답변 : 아두이노 속도측정, 속도를 LCD에 표시, 가까워지면 부저 새글 master 22-05-27 17
질문 블루투스 관련 코드 도와주세요 새글 scape 22-05-27 19
답변 답변글 답변 : 블루투스 관련 코드 도와주세요 새글 master 22-05-27 16
질문 ATmega128 1602A LCD 출력 질문입니다.댓글[2] 새글 444222a 22-05-27 34
질문 ATmega128 스위치 채터링 관련 질문드립니다댓글[3] 새글 yeon 22-05-27 37
질문 마이크로칩 스튜디오 코드 해석 새글 최선을다하자 22-05-27 21
답변 답변글 답변 : 마이크로칩 스튜디오 코드 해석 새글 master 22-05-27 18
질문 적외선 거리 센서로 블루투스 알람 설정 코딩...댓글[1] 새글 ededed 22-05-26 22
질문 아두이노 api 질문댓글[1] 새글첨부파일 리니어 22-05-26 21
질문 atmega128 키패드 입력 오류에 대하여 질문 있습니다.댓글[2] 새글 마프하나 22-05-26 50
질문 초음파센싱을 통한 리니어벨트 (스텝모터사용) 조건문댓글[1] 새글 아두이노대학 22-05-26 31
질문 아트메가128/ srf05 초음파센서를 이용한 타이머 인터럽트 질문입니다 새글 아트메가넘어려워 22-05-26 31
답변 답변글 답변 : 아트메가128/ srf05 초음파센서를 이용한 타이머 인터럽트 질문입니다 새글 master 22-05-26 31
질문 atmega128에서 스위치1개는LED, 스위치 1개는 세그먼트의 동작하게 하려는데.. aasdw 22-05-26 59
답변 답변글 답변 : atmega128에서 스위치1개는LED, 스위치 1개는 세그먼트의 동작하게 하려는데..댓글[1] 새글 master 22-05-26 34
질문 Atmega128 블루투스 오류 질문 yhj2644 22-05-26 58
답변 답변글 답변 : Atmega128 블루투스 오류 질문 새글 master 22-05-26 33
질문 아두이노 간단한 프로그램 행복지수업 22-05-25 49
답변 답변글 답변 : 아두이노 간단한 프로그램 새글 master 22-05-26 31
질문 atmega128 타이머 작성시 키패트 입력으로 인터럽트 사용에 대하여 질문이 있습니다.댓글[1] 이미지 마프하나 22-05-25 92
질문 로드셀 무게 센서 질문드립니다.댓글[2] 제비고기 22-05-25 58
게시물 검색

2022년 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월
2021년 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월
2020년 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월
2019년 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월
2018년 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월
Privacy Policy
MCU BASIC ⓒ 2020
모바일버전으로보기