本帖最后由 hdydy 于 2024-1-27 21:47 编辑
参考
https://www.cnblogs.com/kirito-c/p/5971988.html
https://blog.csdn.net/u014636245/article/details/83661559
串口打印视频帧
![image.png image.png](data/attachment/forum/202401/27/205643k3a42uhh94524eup.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);
}
|