欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136
標題:
在stm32f4將字變大的源碼
[打印本頁]
作者:
xiangfangyue
時間:
2018-4-30 17:39
標題:
在stm32f4將字變大的源碼
單片機源程序如下:
#include "stm32f4xx.h"
#include "usart.h"
#include "led.h"
#include "gpio.h"
#include "stdio.h"
#include "timer.h"
#include "lcd.h"
u8 word[] =
{
0x20,0x02,0x70,0x0A,0x1E,0x12,0x10,0x12,0x10,0x02,0xFF,0x7F,0x10,0x02,0x10,0x22,0x50,0x22,0x30,0x12,0x18,0x0C,0x16,0x44,0x10,0x4A,0x10,0x51,0xD4,0x60,0x08,0x40
};
void drawBlock(u16 xPos, u16 yPos, u16 w, u16 color);
void drawWord(u16 xPos, u16 yPos, u8 *p, u16 lineColor, u16 backColor);
void fjByte(u16 xPos, u16 yPos, u8 byte, u16 lineColor, u16 backColor); // 顯示8個點
// 放大
void pointToBig(u16 xPos, u16 yPos, u16 color, u8 bs);
void fjByteToBig(u16 xPos, u16 yPos, u8 byte, u16 lineColor, u16 backColor, u8 bs);
void drawWordToBig(u16 xPos, u16 yPos, u8 *p, u16 lineColor, u16 backColor, u8 bs);
int main()
{
LCD_Init();
drawWordToBig(10, 100, word, 0x3838, 0x0000, 10);
while(1)
{
}
}
void pointToBig(u16 xPos, u16 yPos, u16 color, u8 bs)
{
u8 i, j;
for(i = 0; i < bs; i++)
{
for(j = 0; j < bs; j++)
{
LCD_Draw_Point(xPos+j, yPos+i, color);
}
}
}
void fjByteToBig(u16 xPos, u16 yPos, u8 byte, u16 lineColor, u16 backColor, u8 bs)
{
u8 i;
for(i = 0; i < 8; i++)
{
if(byte & (1 << i))
{
pointToBig(xPos+i*bs, yPos, lineColor, bs);
}
else
{
pointToBig(xPos+i*bs, yPos, backColor, bs);
}
}
}
void fjByte(u16 xPos, u16 yPos, u8 byte, u16 lineColor, u16 backColor)
{
u8 i;
for(i = 0; i < 8; i++)
{
if(byte & (1 << i))
{
LCD_Draw_Point(xPos + i, yPos, lineColor);
}
else
{
LCD_Draw_Point(xPos + i, yPos, backColor);
}
}
}
void drawWordToBig(u16 xPos, u16 yPos, u8 *p, u16 lineColor, u16 backColor, u8 bs)
{
u8 i;
for(i = 0; i < 16; i++)
{
fjByteToBig(xPos, yPos+i*bs, p[2*i], lineColor, backColor, bs);
fjByteToBig(xPos+8*bs, yPos+i*bs, p[2*i+1], lineColor, backColor, bs);
}
}
void drawWord(u16 xPos, u16 yPos, u8 *p, u16 lineColor, u16 backColor)
{
u8 i;
for(i = 0; i < 16; i++)
{
fjByte(xPos, yPos+i, p[2*i], lineColor, backColor);
fjByte(xPos+8, yPos+i, p[2*i+1], lineColor, backColor);
}
}
void drawBlock(u16 xPos, u16 yPos, u16 w, u16 color)
{
u16 x, y;
for(y = yPos; y < yPos + w; y++)
{
for(x = xPos; x < xPos + w; x++)
{
LCD_Draw_Point(x, y, color);
}
}
}
// RGB
// 0011 1 000 000 0 0000
// 16λ
// 5 6 5
//
復制代碼
所有資料51hei提供下載:
08_變大.rar
(198.67 KB, 下載次數: 6)
2018-5-1 03:52 上傳
點擊文件名下載附件
cortexM4 寫大字
下載積分: 黑幣 -5
歡迎光臨 (http://m.raoushi.com/bbs/)
Powered by Discuz! X3.1