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

인기검색어 > 아두이노 센서 ATMEGA128

최신글 질문게시판 동영상강좌 가입하기

▼ BASIC4MCU 후원업체 신제품 정보 ▼

▲ BASIC4MCU 후원업체 신제품 정보 ▲

BASIC4MCU > 질문게시판

OLED에 큰 폰트를 사용하여 숫자 나타내기

페이지 정보

작성자 kindrightL 작성일20-11-02 13:54 조회11,551회 댓글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

조회수 : 11,551

master님의 댓글

master 작성일

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

게시물 검색

BASIC4MCU > 질문게시판 목록

제목 날짜
공지 MCU, AVR, 아두이노 등 전자공학에 관련된 질문은… 스태프  19-01-15
공지 사이트 이용 안내 댓글[31] master  17-10-29
질문 ATmega4809 nRF24L01 모듈을 이용한 무선… 댓글[3] Ahri  24-06-12
질문 atmega128에 dht11 왜 측정을 못하죠? 댓글[1] 탈북한시민  24-06-11
질문 atmega128이 실행이 되지 않습니다 댓글[1] 첨부파일니굴  24-06-10
질문 아트메가 128 쓰는디 while 문이 안먹혀요 댓글[1] 수히  24-06-09
질문 atmega128 UART통신으로 FND출력 Rion  24-06-09
답변 답변 : atmega128 UART통신으로 FND출력 댓글[1] master  24-06-10
질문 atmega128 라인트레이서 코드와 회로도 질문...… 댓글[2] 첨부파일왕두일  24-06-06
답변 답변 : atmega128 라인트레이서 코드와 회로도 … master  24-06-07
질문 atmega128을 이용한 LCD 사용에 문제가 발생했… 댓글[3] 네넴  24-06-05
질문 Co 센서 값에 따른 ppm을 계산하려는데 댓글[1] 라칸  24-06-05
질문 17HS4401, A4988 스텝모터 제어 댓글[1] jhbaik  24-06-03
질문 코드비전avr을 이용한 아두이노 우노 제어 댓글[1] gkstntjd  24-05-29
질문 Energia 시리얼 모니터에 아무것도 출력되지않습니다… 댓글[1] 김의공  24-05-22
질문 아두이노 스위치, 에어펌프 연결 댓글[1] 첨부파일존존  24-05-20
질문 MSP430런치패드를 이용한 LCD 코딩 관련 질문 댓글[1] 뀨쥰이  24-05-16
질문 생활 속 가스 센서 첨부파일Fosen  24-05-13
질문 atmega128A로 초음파센서 바밤  24-05-13
답변 답변 : atmega128A로 초음파센서 master  24-05-13
질문 eeprom 값 출력이 다르게 나옵니다 댓글[5] 첨부파일idghte  24-05-05
답변 답변 : eeprom 값 출력이 다르게 나옵니다 master  24-05-05
질문 센서나 블루투스에서 조건문이 실행이 느립니다. 현아  24-05-03
답변 답변 : 센서나 블루투스에서 조건문이 실행이 느립니다. master  24-05-03
질문 님들 MG811 이산화탄소 센서를 쓰는데 라칸  24-05-03
답변 답변 : 님들 MG811 이산화탄소 센서를 쓰는데 master  24-05-03
질문 아두이노와 디지털 홀센서 사용 중 sampling ra… 첨부파일fjur564  24-05-03
답변 답변 : 아두이노와 디지털 홀센서 사용 중 sampli… master  24-05-03
질문 OP AMP 댓글[1] 첨부파일창원거북이  24-05-02
질문 라즈베리파이 라우팅 테이블을 영구 추가하려는데 라칸  24-04-30
게시물 검색


Privacy Policy
MCU BASIC ⓒ 2017
PC버전