发帖
17 0 0

串口整活

hdydy
论坛元老

29

主题

68

回帖

4997

积分

论坛元老

积分
4997
技术杂谈 2047 17 2024-1-27 20:56:52

[i=s] 本帖最后由 hdydy 于 2024-1-27 21:47 编辑 [/i]<br /> <br />

参考

https://www.cnblogs.com/kirito-c/p/5971988.html

https://blog.csdn.net/u014636245/article/details/83661559

串口打印视频帧

image.png

void print_rgb() {
    uint8_t r = 0, c = 0;
    uint32_t i = 0;
    printf("RGB_TOTAL_SIZE=%d\n", RGB_TOTAL_SIZE);
    while(i < RGB_TOTAL_SIZE) {
        for(r = 0; r < RGB_HEIGHT; r++) {
            for(c = 0; c < RGB_WIDTH; c++) {
                printf("\e[48;2;%d;%d;%dm ", rgb_data[i], rgb_data[i+1], rgb_data[i+2]);
                i += 3;
                bflb_mtimer_delay_us(2);
            }
            printf("\e[m\n");
        }
        // if(i == RGB_TOTAL_SIZE) i = 0;
        bflb_mtimer_delay_ms(25);
        printf("\e[%dA", RGB_HEIGHT);
    }
    printf("\e[%dB", RGB_HEIGHT);
}

void print_char() {
    uint8_t r = 0, c = 0;
    uint32_t i = 0;
    printf("CHAR_TOTAL_SIZE=%d\n", CHAR_TOTAL_SIZE);
    while(i < CHAR_TOTAL_SIZE) {
        for(r = 0; r < CHAR_HEIGHT; r++) {
            for(c = 0; c < CHAR_WIDTH; c++) {
                printf("%c", char_data[i++]);
                // bflb_mtimer_delay_us(2);
            }
            printf("\e[m\n");
        }
        // if(i == CHAR_TOTAL_SIZE) i = 0;
        bflb_mtimer_delay_ms(25);
        printf("\e[%dA", CHAR_HEIGHT);
    }
    printf("\e[%dB", CHAR_HEIGHT);
}
──── 0人觉得很赞 ────

使用道具 举报

2024-1-27 20:58:20
本帖最后由 hdydy 于 2024-1-28 14:38 编辑

代码

video2char.zip

77.92 KB, 下载次数: 1

2024-1-27 21:24:02
2024-1-27 21:35:55
2024-1-27 22:31:03
赞一个
2024-1-27 22:55:24
👍
2024-1-28 07:25:43
好玩极了
2024-1-28 08:09:14
2024-1-28 13:30:09
赞一个
2024-1-28 14:18:25
赞一个
您需要登录后才可以回帖 立即登录
高级模式
12下一页
统计信息
  • 会员数: 28097 个
  • 话题数: 39303 篇