STM32MIN板点亮显示屏,取模显示图片
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了STM32MIN板点亮显示屏,取模显示图片相关的知识,希望对你有一定的参考价值。
使用Img2Lcd软件进行取模,如果显示屏分辨率较小,可以先将图片像素化之后再进行取模,这样显示效果会好一些。
显示效果如上,使用多张图片,也可以显示简单动画。下附全部代码。
mani.c
#include "stm32f10x.h"
#include "delay.h"
#include "usart.h"
#include "oled.h"
#include "bsp_i2c.h"
#include "bmp.h"
int main(void)
delay_init();
NVIC_Configuration(); //设置NVIC中断分组2:2位抢占优先级,2位响应优先级
uart_init(9600); //串口初始化为9600
OLED_Init(); //初始化OLED
OLED_Clear(0) ;
while(1)
OLED_DrawBMP(7,0,127,8,BMP1); //括号内数据对应图面的起始位置
delay_ms(200);
oled.c
//=========================================电源接线================================================//
// 5V 接DC 5V电源
// GND 接地
//======================================OLED屏数据线接线==========================================//
//本模块数据总线类型为IIC
// SCL 接PB13 // IIC时钟信号
// SDA 接PB14 // IIC数据信号
//======================================OLED屏控制线接线==========================================//
//本模块数据总线类型为IIC,不需要接控制信号线
//=========================================触摸屏接线=========================================//
//本模块本身不带触摸,不需要接触摸屏线
//============================================================================================//
#include "oled.h"
#include "stdlib.h"
#include "oledfont.h"
#include "delay.h"
//OLED的显存
//存放格式如下.
//[0]0 1 2 3 ... 127
//[1]0 1 2 3 ... 127
//[2]0 1 2 3 ... 127
//[3]0 1 2 3 ... 127
//[4]0 1 2 3 ... 127
//[5]0 1 2 3 ... 127
//[6]0 1 2 3 ... 127
//[7]0 1 2 3 ... 127
/**********************************************
//IIC Start
**********************************************/
/**********************************************
//IIC Start
**********************************************/
//初始化SSD1306
void OLED_Init(void)
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); //使能PB端口时钟
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13|GPIO_Pin_14; //PB13,PB14推挽输出
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; //推挽输出
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;//速度50MHz
GPIO_Init(GPIOB, &GPIO_InitStructure); //初始化GPIOB13,14
GPIO_SetBits(GPIOB,GPIO_Pin_13|GPIO_Pin_14); //PB13,PB14 输出高
delay_ms(200);
OLED_WR_Byte(0xAE,OLED_CMD);//--display off
OLED_WR_Byte(0x00,OLED_CMD);//---set low column address
OLED_WR_Byte(0x10,OLED_CMD);//---set high column address
OLED_WR_Byte(0x40,OLED_CMD);//--set start line address
OLED_WR_Byte(0xB0,OLED_CMD);//--set page address
OLED_WR_Byte(0x81,OLED_CMD); // contract control
OLED_WR_Byte(0xFF,OLED_CMD);//--128
OLED_WR_Byte(0xA1,OLED_CMD);//set segment remap
OLED_WR_Byte(0xA6,OLED_CMD);//--normal / reverse
OLED_WR_Byte(0xA8,OLED_CMD);//--set multiplex ratio(1 to 64)
OLED_WR_Byte(0x3F,OLED_CMD);//--1/32 duty
OLED_WR_Byte(0xC8,OLED_CMD);//Com scan direction
OLED_WR_Byte(0xD3,OLED_CMD);//-set display offset
OLED_WR_Byte(0x00,OLED_CMD);//
OLED_WR_Byte(0xD5,OLED_CMD);//set osc division
OLED_WR_Byte(0x80,OLED_CMD);//
OLED_WR_Byte(0xD8,OLED_CMD);//set area color mode off
OLED_WR_Byte(0x05,OLED_CMD);//
OLED_WR_Byte(0xD9,OLED_CMD);//Set Pre-Charge Period
OLED_WR_Byte(0xF1,OLED_CMD);//
OLED_WR_Byte(0xDA,OLED_CMD);//set com pin configuartion
OLED_WR_Byte(0x12,OLED_CMD);//
OLED_WR_Byte(0xDB,OLED_CMD);//set Vcomh
OLED_WR_Byte(0x30,OLED_CMD);//
OLED_WR_Byte(0x8D,OLED_CMD);//set charge pump enable
OLED_WR_Byte(0x14,OLED_CMD);//
OLED_WR_Byte(0xAF,OLED_CMD);//--turn on oled panel
void IIC_Start()
OLED_SCLK_Set() ;
OLED_SDIN_Set();
OLED_SDIN_Clr();
OLED_SCLK_Clr();
/**********************************************
//IIC Stop
**********************************************/
void IIC_Stop()
OLED_SCLK_Set() ;
// OLED_SCLK_Clr();
OLED_SDIN_Clr();
OLED_SDIN_Set();
void IIC_Wait_Ack()
OLED_SCLK_Set() ;
OLED_SCLK_Clr();
/**********************************************
// IIC Write byte
**********************************************/
void Write_IIC_Byte(unsigned char IIC_Byte)
unsigned char i;
unsigned char m,da;
da=IIC_Byte;
OLED_SCLK_Clr();
for(i=0;i<8;i++)
m=da;
// OLED_SCLK_Clr();
m=m&0x80;
if(m==0x80)
OLED_SDIN_Set();
else OLED_SDIN_Clr();
da=da<<1;
OLED_SCLK_Set();
OLED_SCLK_Clr();
/**********************************************
// IIC Write Command
**********************************************/
void Write_IIC_Command(unsigned char IIC_Command)
IIC_Start();
Write_IIC_Byte(IIC_SLAVE_ADDR); //Slave address,SA0=0
IIC_Wait_Ack();
Write_IIC_Byte(0x00); //write command
IIC_Wait_Ack();
Write_IIC_Byte(IIC_Command);
IIC_Wait_Ack();
IIC_Stop();
/**********************************************
// IIC Write Data
**********************************************/
void Write_IIC_Data(unsigned char IIC_Data)
IIC_Start();
Write_IIC_Byte(IIC_SLAVE_ADDR); //D/C#=0; R/W#=0
IIC_Wait_Ack();
Write_IIC_Byte(0x40); //write data
IIC_Wait_Ack();
Write_IIC_Byte(IIC_Data);
IIC_Wait_Ack();
IIC_Stop();
void OLED_WR_Byte(unsigned dat,unsigned cmd)
if(cmd)
Write_IIC_Data(dat);
else
Write_IIC_Command(dat);
/********************************************
// fill_Picture
********************************************/
void fill_picture(unsigned char fill_Data)
unsigned char m,n;
for(m=0;m<8;m++)
OLED_WR_Byte(0xb0+m,0); //page0-page1
OLED_WR_Byte(0x00,0); //low column start address
OLED_WR_Byte(0x10,0); //high column start address
for(n=0;n<128;n++)
OLED_WR_Byte(fill_Data,1);
/***********************Delay****************************************/
void Delay_50ms(unsigned int Del_50ms)
unsigned int m;
for(;Del_50ms>0;Del_50ms--)
for(m=6245;m>0;m--);
void Delay_1ms(unsigned int Del_1ms)
unsigned char j;
while(Del_1ms--)
for(j=0;j<123;j++);
//坐标设置
void OLED_Set_Pos(unsigned char x, unsigned char y)
OLED_WR_Byte(0xb0+y,OLED_CMD);
OLED_WR_Byte(((x&0xf0)>>4)|0x10,OLED_CMD);
OLED_WR_Byte((x&0x0f),OLED_CMD);
//开启OLED显示
void OLED_Display_On(void)
OLED_WR_Byte(0X8D,OLED_CMD); //SET DCDC命令
OLED_WR_Byte(0X14,OLED_CMD); //DCDC ON
OLED_WR_Byte(0XAF,OLED_CMD); //DISPLAY ON
//关闭OLED显示
void OLED_Display_Off(void)
OLED_WR_Byte(0X8D,OLED_CMD); //SET DCDC命令
OLED_WR_Byte(0X10,OLED_CMD); //DCDC OFF
OLED_WR_Byte(0XAE,OLED_CMD); //DISPLAY OFF
//清屏函数,清完屏,整个屏幕是黑色的!和没点亮一样!!!
void OLED_Clear(unsigned dat)
u8 i,n;
for(i=0;i<8;i++)
OLED_WR_Byte (0xb0+i,OLED_CMD); //设置页地址(0~7)
OLED_WR_Byte (0x00,OLED_CMD); //设置显示位置—列低地址
OLED_WR_Byte (0x10,OLED_CMD); //设置显示位置—列高地址
for(n=0;n<128;n++)OLED_WR_Byte(dat,OLED_DATA);
//更新显示
void OLED_On(void)
u8 i,n;
for(i=0;i<8;i++)
OLED_WR_Byte (0xb0+i,OLED_CMD); //设置页地址(0~7)
OLED_WR_Byte (0x00,OLED_CMD); //设置显示位置—列低地址
OLED_WR_Byte (0x10,OLED_CMD); //设置显示位置—列高地址
for(n=0;n<128;n++)OLED_WR_Byte(1,OLED_DATA);
//更新显示
//在指定位置显示一个字符,包括部分字符
//x:0~127
//y:0~63
//mode:0,反白显示;1,正常显示
//size:选择字体 16/12
void OLED_ShowChar(u8 x,u8 y,u8 chr,u8 Char_Size)
unsigned char c=0,i=0;
c=chr- ;//得到偏移后的值
if(x>Max_Column-1)x=0;y=y+2;
if(Char_Size ==16)
OLED_Set_Pos(x,y);
for(i=0;i<8;i++)
OLED_WR_Byte(F8X16[c*16+i],OLED_DATA);
OLED_Set_Pos(x,y+1);
for(i=0;i<8;i++)
OLED_WR_Byte(F8X16[c*16+i+8],OLED_DATA);
else
OLED_Set_Pos(x,y);
for(i=0;i<6;i++)
OLED_WR_Byte(F6x8[c][i],OLED_DATA);
//m^n函数
u32 oled_pow(u8 m,u8 n)
u32 result=1;
while(n--)result*=m;
return result;
//显示2个数字
//x,y :起点坐标
//len :数字的位数
//size:字体大小
//mode:模式 0,填充模式;1,叠加模式
//num:数值(0~4294967295);
void OLED_ShowNum(u8 x,u8 y,u32 num,u8 len,u8 size2)
u8 t,temp;
u8 enshow=0;
for(t=0;t<len;t++)
temp=(num/oled_pow(10,len-t-1))%10;
if(enshow==0&&t<(len-1))
if(temp==0)
OLED_ShowChar(x+(size2/2)*t,y, ,size2);
continue;
else enshow=1;
OLED_ShowChar(x+(size2/2)*t,y,temp+0,size2);
//显示一个字符号串
void OLED_ShowString(u8 x,u8 y,u8 *chr,u8 Char_Size)
unsigned char j=0;
while (chr[j]!=\\0)
OLED_ShowChar(x,y,chr[j],Char_Size);
x+=8;
if(x>120)x=0;y+=2;
j++;
//显示汉字
void OLED_ShowCHinese(u8 x,u8 y,u8 no)
u8 t,adder=0;
OLED_Set_Pos(x,y);
for(t=0;t<16;t++)
OLED_WR_Byte(Hzk[2*no][t],OLED_DATA);
adder+=1;
OLED_Set_Pos(x,y+1);
for(t=0;t<16;t++)
OLED_WR_Byte(Hzk[2*no+1][t],OLED_DATA);
adder+=1;
/***********功能描述:显示显示BMP图片128×64起始点坐标(x,y),x的范围0~127,y为页的范围0~7*****************/
//x0:横坐标;y0:纵坐标;x1:图片起点;y1:所占页数;BMP[]:选用的结构体名称
void OLED_DrawBMP(unsigned char x0, unsigned char y0,unsigned char x1, unsigned char y1,unsigned char BMP[])
unsigned int j=0;
unsigned char x,y;
if(y1%8==0) y=y1/8;
else y=y1/8+1;
for(y=y0;y<y1;y++)
OLED_Set_Pos(x0,y);
for(x=x0;x<x1;x++)
OLED_WR_Byte(BMP[j++],OLED_DATA);
// Parameters : x0,y0 -- 起始点坐标(x0:0~127, y0:0~7); x1,y1 -- 起点对角线(结束点)的坐标(x1:1~128,y1:1~8)
// Description : 显示BMP位图
//void OLED_DrawBMP(unsigned char x0,unsigned char y0,unsigned char x1,unsigned char y1,unsigned char BMP[])
//
// unsigned int j=0;
// unsigned char x,y;
//
// if(y1%8==0)
// y = y1/8;
// else
// y = y1/8 + 1;
// for(y=y0;y<y1;y++)
//
// OLED_SetPos(x0,y);
// for(x=x0;x<x1;x++)
//
// WriteDat(BMP[j++]);
//
//
//
oled.h
/****************************************************************************************************
//=========================================电源接线================================================//
// 5V 接DC 5V电源
// GND 接地
//======================================OLED屏数据线接线==========================================//
//本模块数据总线类型为IIC
// SCL 接PB13 // IIC时钟信号
// SDA 接PB14 // IIC数据信号
//======================================OLED屏控制线接线==========================================//
//本模块数据总线类型为IIC,不需要接控制信号线
//=========================================触摸屏接线=========================================//
//本模块本身不带触摸,不需要接触摸屏线
//============================================================================================//
* @attention
*
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
* TIME. AS A RESULT, QD electronic SHALL NOT BE HELD LIABLE FOR ANY
* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
**************************************************************************************************/
#ifndef __OLED_H
#define __OLED_H
#include "sys.h"
#include "stdlib.h"
#define OLED_MODE 0
#define SIZE 8
#define XLevelL 0x00
#define XLevelH 0x10
#define Max_Column 128
#define Max_Row 64
#define Brightness 0xFF
#define X_WIDTH 128
#define Y_WIDTH 64
//-----------------OLED IIC端口定义----------------
#define OLED_SCLK_Clr() GPIO_ResetBits(GPIOB,GPIO_Pin_13)//SDA IIC接口的时钟信号
#define OLED_SCLK_Set() GPIO_SetBits(GPIOB,GPIO_Pin_13)
#define OLED_SDIN_Clr() GPIO_ResetBits(GPIOB,GPIO_Pin_14)//SCL IIC接口的数据信号
#define OLED_SDIN_Set() GPIO_SetBits(GPIOB,GPIO_Pin_14)
#define OLED_CMD 0 //写命令
#define OLED_DATA 1 //写数据
#define IIC_SLAVE_ADDR 0x78 //IIC slave device address
//OLED控制用函数
void OLED_WR_Byte(unsigned dat,unsigned cmd);
void OLED_Display_On(void);
void OLED_Display_Off(void);
void OLED_Init(void);
void OLED_Clear(unsigned dat);
void OLED_DrawPoint(u8 x,u8 y,u8 t);
void OLED_Fill(u8 x1,u8 y1,u8 x2,u8 y2,u8 dot);
void OLED_ShowChar(u8 x,u8 y,u8 chr,u8 Char_Size);
void OLED_ShowNum(u8 x,u8 y,u32 num,u8 len,u8 size);
void OLED_ShowString(u8 x,u8 y, u8 *p,u8 Char_Size);
void OLED_Set_Pos(unsigned char x, unsigned char y);
void OLED_ShowCHinese(u8 x,u8 y,u8 no);
void OLED_DrawBMP(unsigned char x0, unsigned char y0,unsigned char x1, unsigned char y1,unsigned char BMP[]);
void Delay_50ms(unsigned int Del_50ms);
void Delay_1ms(unsigned int Del_1ms);
void fill_picture(unsigned char fill_Data);
void Picture(void);
void IIC_Start(void);
void IIC_Stop(void);
void Write_IIC_Command(unsigned char IIC_Command);
void Write_IIC_Data(unsigned char IIC_Data);
void Write_IIC_Byte(unsigned char IIC_Byte);
void IIC_Wait_Ack(void);
#endif
bmp.h
/****************************************************************************************************
//=========================================电源接线================================================//
// 5V 接DC 5V电源
// GND 接地
//======================================OLED屏数据线接线==========================================//
//本模块数据总线类型为IIC
// SCL 接PB13 // IIC时钟信号
// SDA 接PB14 // IIC数据信号
//======================================OLED屏控制线接线==========================================//
//本模块数据总线类型为IIC,不需要接控制信号线
//=========================================触摸屏接线=========================================//
//本模块本身不带触摸,不需要接触摸屏线
//存储图片数据,图片大小为64*32像素
#ifndef __BMP_H
#define __BMP_H
unsigned char BMP1[] =
0X22,0X01,0X78,0X00,0X3E,0X00,
0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0X40,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X80,0X00,0X00,0XF0,0XF8,0X38,0X08,0X68,0XE8,0XC8,0XC8,0XC8,
0X90,0XC0,0XC0,0XD0,0XE0,0XE0,0XC0,0XD0,0XB8,0X58,0X58,0XD8,0XC8,0XC0,0XC0,0XC0,
0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XC0,0XC0,0XC0,0XC0,
0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0X40,0X40,0X00,0X00,0X00,0X00,0X00,0X40,0X00,0X00,
0X00,0X00,0X00,0X00,0X40,0XC0,0XC0,0X40,0X00,0X80,0X80,0X00,0X00,0XC0,0XC0,0X40,
0X40,0X40,0X40,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,
0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0X03,0X01,0X01,0X01,0X01,0X1C,0XF8,0X67,
0X06,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X07,0X3C,0X7C,0XFF,
0XC7,0XC7,0XC7,0X81,0X81,0XFF,0XFF,0XC3,0XC3,0XC1,0XC0,0XC1,0XC7,0X7F,0XFF,0XF9,
0X79,0X3F,0X3F,0X7E,0XFD,0XFB,0XDF,0X7F,0XFF,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0XFF,0XFF,0XFF,0XFF,0X03,0X03,0X01,0X81,0X01,0X1C,0X3C,0XF8,
0X47,0X1C,0X80,0XC0,0XE0,0X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01,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X08,0X7C,0XF8,0XFC,0XFE,0XFF,0XFF,0X00,
0X00,0X00,0X00,0X00,0X00,0XB0,0XD0,0X41,0XA1,0XF1,0X30,0XD0,0XF0,0XF3,0XF3,0X4F,
0X7F,0X3F,0X3C,0X3B,0X33,0X7F,0XE7,0XE7,0XE7,0XEF,0XEF,0X7F,0X7F,0X4F,0X4F,0X4F,
0X0F,0X0F,0X4F,0X1F,0X3F,0X3F,0X8B,0X0B,0X09,0X1C,0X1E,0X1F,0X1F,0X3F,0X3F,0X3F,
0X43,0X38,0X38,0X78,0X20,0X20,0X00,0X03,0X13,0X3F,0X00,0XB0,0XD0,0XC0,0X61,0XE1,
0XFE,0XCB,0XCB,0XC3,0X4F,0X3F,0XFE,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X30,0X40,0X80,0X8C,0XFF,0XFF,0XFF,0XFF,0X80,0X00,0X00,0X00,
0X80,0XC0,0XC0,0XC0,0XF0,0XCE,0XB3,0XF0,0X40,0X4C,0X44,0X40,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X40,0X4E,0X33,0XBF,0X3C,0XFD,
0XCE,0XFF,0XC3,0XFF,0XCF,0X01,0X01,0X60,0X00,0X00,0XC0,0X80,0X80,0X80,0X80,0X81,
0XB8,0X8C,0X8E,0X8F,0XCF,0XC1,0XC2,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X0E,0X3C,0XFC,0XFC,0XFC,
0XFC,0XFE,0X7F,0XB3,0XBF,0XFD,0XCF,0XFE,0X0E,0X0F,0X0F,0X0F,0X00,0X06,0X01,0X00,
0X00,0X00,0X00,0X00,0X18,0X00,0X08,0X04,0X04,0X00,0X05,0X01,0X09,0X00,0X06,0X0F,
0X1F,0X39,0X36,0X0E,0X1F,0X3F,0X3D,0X3C,0X1F,0X8E,0X18,0X0D,0X87,0X03,0X00,0X00,
0X80,0X00,0X00,0X08,0X70,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X80,0X00,0X00,0X00,0X40,0X02,0X07,0X09,0XC3,0X06,0X07,0X07,0XC1,0X04,0X06,0X02,
0X00,0X00,0X00,0X05,0X43,0X03,0X07,0X03,0X30,0XB2,0X32,0X37,0XBF,0X3F,0X3F,0X3F,
0X3F,0X3C,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X80,0X00,0X00,0X00,0X10,0X08,0X10,
0X90,0X40,0X20,0X00,0X00,0XC1,0X01,0X03,0X03,0X43,0X00,0X0A,0X07,0X0D,0X0B,0X0E,
;
#endif
ESP8266图传功能:通过UDP给esp8266发送图片数据并显示
ESP8266图传功能通过UDP客户端给esp8266发送图片数据并显示
说通俗一点就是实现esp8266图传功能。
arduino高级9-python-opencv取模-esp底层udp设计#跟着John一起学开发
实现原理分析
通过udp数据传送,将我们需要发送的数据发给目标–
esp8266
接收板,然后esp8266对数据进行解析,并通过OLED显示出图像出来。
- 由于esp8266驱动的显示屏幕是0.96寸的ssd1306 IIC屏幕,我们发送过去的图片最好先提前做好处理,因为esp8266驱动的是0.96寸的屏幕,你不能给他传个1024*1024的图片让其显示吧。
我就以下面这张图片为例:
图片处理步骤
<以上是关于STM32MIN板点亮显示屏,取模显示图片的主要内容,如果未能解决你的问题,请参考以下文章
最小系统板 STM32入门,点亮 LED 灯(STM32F103C6T6)
最小系统板 STM32入门,点亮 LED 灯(STM32F103C6T6)