STM32单片机DS18B20测温程序源代码

news2024/11/26 5:52:24

OLED液晶屏电路接口

DS18B20电路接口

STM32单片机DS18B20测温程序源代码

#include "sys.h"

#define LED_RED PBout(12)

#define LED_GREEN PBout(13)

#define LED_YELLOW PBout(14)

#define LED_BLUE PBout(15)

#define DS18B20_IO_IN() {GPIOA->CRL&=0XFFFFFFF0;GPIOA->CRL|=8<<0;}

#define DS18B20_IO_OUT() {GPIOA->CRL&=0XFFFFFFF0;GPIOA->CRL|=3<<0;}

#define DS18B20_DQ_OUTPAout(0) //数据端口PA0

#define DS18B20_DQ_IN PAin(0) //数据端口PA0

#define OLED_RST_Clr() PCout(13)=0 //RST

#define OLED_RST_Set() PCout(13)=1 //RST

#define OLED_RS_Clr() PBout(4)=0 //DC

#define OLED_RS_Set() PBout(4)=1 //DC

#define OLED_SCLK_Clr() PCout(15)=0 //SCL

#define OLED_SCLK_Set() PCout(15)=1 //SCL

#define OLED_SDIN_Clr() PCout(14)=0 //SDA

#define OLED_SDIN_Set() PCout(14)=1 //SDA

#define OLED_CMD 0 //写命令

#define OLED_DATA 1 //写数据

static u8 fac_us=0; //us延时倍乘数

static u16 fac_ms=0; //ms延时倍乘数

void delay_init(u8 SYSCLK);

void delay_ms(u16 nms);

void delay_us(u32 nus);

void Led_Init(void);

void Red_Led_Light(void);

void Green_Led_Light(void);

void Yellow_Led_Light(void);

void Blue_Led_Light(void);

void Red_Led_Goout(void);

void Green_Led_Goout(void);

void Yellow_Led_Goout(void);

void Blue_Led_Goout(void);

u8 DS18B20_Init(void); //初始化DS18B20

short DS18B20_Get_Temp(void); //获取温度

void DS18B20_Start(void); //开始温度转换

void DS18B20_Write_Byte(u8 dat); //写入一个字节

u8 DS18B20_Read_Byte(void); //读出一个字节

u8 DS18B20_Read_Bit(void); //读出一个位

u8 DS18B20_Check(void); //检测是否存在DS18B20

void DS18B20_Rst(void); //复位DS18B20

void OLED_WR_Byte(u8 dat,u8 cmd);

void OLED_Display_On(void);

void OLED_Display_Off(void);

void OLED_Refresh_Gram(void);

void Oled_Init(void);

void OLED_Clear(void);

void OLED_DrawPoint(u8 x,u8 y,u8 t);

void OLED_ShowChar(u8 x,u8 y,u8 chr,u8size,u8 mode);

void OLED_ShowNumber(u8 x,u8 y,u32num,u8 len,u8 size);

void OLED_ShowString(u8 x,u8 y,const u8*p);

void Oled_Show(void);

u8 OLED_GRAM[128][8];

const unsigned char oled_asc2_1206[95][12]={

{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"",0*/

{0x00,0x00,0x00,0x00,0x3F,0x40,0x00,0x00,0x00,0x00,0x00,0x00},/*"!",1*/

{0x00,0x00,0x30,0x00,0x40,0x00,0x30,0x00,0x40,0x00,0x00,0x00},/*""",2*/

{0x09,0x00,0x0B,0xC0,0x3D,0x00,0x0B,0xC0,0x3D,0x00,0x09,0x00},/*"#",3*/

{0x18,0xC0,0x24,0x40,0x7F,0xE0,0x22,0x40,0x31,0x80,0x00,0x00},/*"$",4*/

{0x18,0x00,0x24,0xC0,0x1B,0x00,0x0D,0x80,0x32,0x40,0x01,0x80},/*"%",5*/

{0x03,0x80,0x1C,0x40,0x27,0x40,0x1C,0x80,0x07,0x40,0x00,0x40},/*"&",6*/

{0x10,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"'",7*/

{0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x80,0x20,0x40,0x40,0x20},/*"(",8*/

{0x00,0x00,0x40,0x20,0x20,0x40,0x1F,0x80,0x00,0x00,0x00,0x00},/*")",9*/

{0x09,0x00,0x06,0x00,0x1F,0x80,0x06,0x00,0x09,0x00,0x00,0x00},/*"*",10*/

{0x04,0x00,0x04,0x00,0x3F,0x80,0x04,0x00,0x04,0x00,0x00,0x00},/*"+",11*/

{0x00,0x10,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*",",12*/

{0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x00,0x00},/*"-",13*/

{0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*".",14*/

{0x00,0x20,0x01,0xC0,0x06,0x00,0x38,0x00,0x40,0x00,0x00,0x00},/*"/",15*/

{0x1F,0x80,0x20,0x40,0x20,0x40,0x20,0x40,0x1F,0x80,0x00,0x00},/*"0",16*/

{0x00,0x00,0x10,0x40,0x3F,0xC0,0x00,0x40,0x00,0x00,0x00,0x00},/*"1",17*/

{0x18,0xC0,0x21,0x40,0x22,0x40,0x24,0x40,0x18,0x40,0x00,0x00},/*"2",18*/

{0x10,0x80,0x20,0x40,0x24,0x40,0x24,0x40,0x1B,0x80,0x00,0x00},/*"3",19*/

{0x02,0x00,0x0D,0x00,0x11,0x00,0x3F,0xC0,0x01,0x40,0x00,0x00},/*"4",20*/

{0x3C,0x80,0x24,0x40,0x24,0x40,0x24,0x40,0x23,0x80,0x00,0x00},/*"5",21*/

{0x1F,0x80,0x24,0x40,0x24,0x40,0x34,0x40,0x03,0x80,0x00,0x00},/*"6",22*/

{0x30,0x00,0x20,0x00,0x27,0xC0,0x38,0x00,0x20,0x00,0x00,0x00},/*"7",23*/

{0x1B,0x80,0x24,0x40,0x24,0x40,0x24,0x40,0x1B,0x80,0x00,0x00},/*"8",24*/

{0x1C,0x00,0x22,0xC0,0x22,0x40,0x22,0x40,0x1F,0x80,0x00,0x00},/*"9",25*/

{0x00,0x00,0x00,0x00,0x08,0x40,0x00,0x00,0x00,0x00,0x00,0x00},/*":",26*/

{0x00,0x00,0x00,0x00,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00},/*";",27*/

{0x00,0x00,0x04,0x00,0x0A,0x00,0x11,0x00,0x20,0x80,0x40,0x40},/*"<",28*/

{0x09,0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x00,0x00},/*"=",29*/

{0x00,0x00,0x40,0x40,0x20,0x80,0x11,0x00,0x0A,0x00,0x04,0x00},/*">",30*/

{0x18,0x00,0x20,0x00,0x23,0x40,0x24,0x00,0x18,0x00,0x00,0x00},/*"?",31*/

{0x1F,0x80,0x20,0x40,0x27,0x40,0x29,0x40,0x1F,0x40,0x00,0x00},/*"@",32*/

{0x00,0x40,0x07,0xC0,0x39,0x00,0x0F,0x00,0x01,0xC0,0x00,0x40},/*"A",33*/

{0x20,0x40,0x3F,0xC0,0x24,0x40,0x24,0x40,0x1B,0x80,0x00,0x00},/*"B",34*/

{0x1F,0x80,0x20,0x40,0x20,0x40,0x20,0x40,0x30,0x80,0x00,0x00},/*"C",35*/

{0x20,0x40,0x3F,0xC0,0x20,0x40,0x20,0x40,0x1F,0x80,0x00,0x00},/*"D",36*/

{0x20,0x40,0x3F,0xC0,0x24,0x40,0x2E,0x40,0x30,0xC0,0x00,0x00},/*"E",37*/

{0x20,0x40,0x3F,0xC0,0x24,0x40,0x2E,0x00,0x30,0x00,0x00,0x00},/*"F",38*/

{0x0F,0x00,0x10,0x80,0x20,0x40,0x22,0x40,0x33,0x80,0x02,0x00},/*"G",39*/

{0x20,0x40,0x3F,0xC0,0x04,0x00,0x04,0x00,0x3F,0xC0,0x20,0x40},/*"H",40*/

{0x20,0x40,0x20,0x40,0x3F,0xC0,0x20,0x40,0x20,0x40,0x00,0x00},/*"I",41*/

{0x00,0x60,0x20,0x20,0x20,0x20,0x3F,0xC0,0x20,0x00,0x20,0x00},/*"J",42*/

{0x20,0x40,0x3F,0xC0,0x24,0x40,0x0B,0x00,0x30,0xC0,0x20,0x40},/*"K",43*/

{0x20,0x40,0x3F,0xC0,0x20,0x40,0x00,0x40,0x00,0x40,0x00,0xC0},/*"L",44*/

{0x3F,0xC0,0x3C,0x00,0x03,0xC0,0x3C,0x00,0x3F,0xC0,0x00,0x00},/*"M",45*/

{0x20,0x40,0x3F,0xC0,0x0C,0x40,0x23,0x00,0x3F,0xC0,0x20,0x00},/*"N",46*/

{0x1F,0x80,0x20,0x40,0x20,0x40,0x20,0x40,0x1F,0x80,0x00,0x00},/*"O",47*/

{0x20,0x40,0x3F,0xC0,0x24,0x40,0x24,0x00,0x18,0x00,0x00,0x00},/*"P",48*/

{0x1F,0x80,0x21,0x40,0x21,0x40,0x20,0xE0,0x1F,0xA0,0x00,0x00},/*"Q",49*/

{0x20,0x40,0x3F,0xC0,0x24,0x40,0x26,0x00,0x19,0xC0,0x00,0x40},/*"R",50*/

{0x18,0xC0,0x24,0x40,0x24,0x40,0x22,0x40,0x31,0x80,0x00,0x00},/*"S",51*/

{0x30,0x00,0x20,0x40,0x3F,0xC0,0x20,0x40,0x30,0x00,0x00,0x00},/*"T",52*/

{0x20,0x00,0x3F,0x80,0x00,0x40,0x00,0x40,0x3F,0x80,0x20,0x00},/*"U",53*/

{0x20,0x00,0x3E,0x00,0x01,0xC0,0x07,0x00,0x38,0x00,0x20,0x00},/*"V",54*/

{0x38,0x00,0x07,0xC0,0x3C,0x00,0x07,0xC0,0x38,0x00,0x00,0x00},/*"W",55*/

{0x20,0x40,0x39,0xC0,0x06,0x00,0x39,0xC0,0x20,0x40,0x00,0x00},/*"X",56*/

{0x20,0x00,0x38,0x40,0x07,0xC0,0x38,0x40,0x20,0x00,0x00,0x00},/*"Y",57*/

{0x30,0x40,0x21,0xC0,0x26,0x40,0x38,0x40,0x20,0xC0,0x00,0x00},/*"Z",58*/

{0x00,0x00,0x00,0x00,0x7F,0xE0,0x40,0x20,0x40,0x20,0x00,0x00},/*"[",59*/

{0x00,0x00,0x70,0x00,0x0C,0x00,0x03,0x80,0x00,0x40,0x00,0x00},/*"\",60*/

{0x00,0x00,0x40,0x20,0x40,0x20,0x7F,0xE0,0x00,0x00,0x00,0x00},/*"]",61*/

{0x00,0x00,0x20,0x00,0x40,0x00,0x20,0x00,0x00,0x00,0x00,0x00},/*"^",62*/

{0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10},/*"_",63*/

{0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"`",64*/

{0x00,0x00,0x02,0x80,0x05,0x40,0x05,0x40,0x03,0xC0,0x00,0x40},/*"a",65*/

{0x20,0x00,0x3F,0xC0,0x04,0x40,0x04,0x40,0x03,0x80,0x00,0x00},/*"b",66*/

{0x00,0x00,0x03,0x80,0x04,0x40,0x04,0x40,0x06,0x40,0x00,0x00},/*"c",67*/

{0x00,0x00,0x03,0x80,0x04,0x40,0x24,0x40,0x3F,0xC0,0x00,0x40},/*"d",68*/

{0x00,0x00,0x03,0x80,0x05,0x40,0x05,0x40,0x03,0x40,0x00,0x00},/*"e",69*/

{0x00,0x00,0x04,0x40,0x1F,0xC0,0x24,0x40,0x24,0x40,0x20,0x00},/*"f",70*/

{0x00,0x00,0x02,0xE0,0x05,0x50,0x05,0x50,0x06,0x50,0x04,0x20},/*"g",71*/

{0x20,0x40,0x3F,0xC0,0x04,0x40,0x04,0x00,0x03,0xC0,0x00,0x40},/*"h",72*/

{0x00,0x00,0x04,0x40,0x27,0xC0,0x00,0x40,0x00,0x00,0x00,0x00},/*"i",73*/

{0x00,0x10,0x00,0x10,0x04,0x10,0x27,0xE0,0x00,0x00,0x00,0x00},/*"j",74*/

{0x20,0x40,0x3F,0xC0,0x01,0x40,0x07,0x00,0x04,0xC0,0x04,0x40},/*"k",75*/

{0x20,0x40,0x20,0x40,0x3F,0xC0,0x00,0x40,0x00,0x40,0x00,0x00},/*"l",76*/

{0x07,0xC0,0x04,0x00,0x07,0xC0,0x04,0x00,0x03,0xC0,0x00,0x00},/*"m",77*/

{0x04,0x40,0x07,0xC0,0x04,0x40,0x04,0x00,0x03,0xC0,0x00,0x40},/*"n",78*/

{0x00,0x00,0x03,0x80,0x04,0x40,0x04,0x40,0x03,0x80,0x00,0x00},/*"o",79*/

{0x04,0x10,0x07,0xF0,0x04,0x50,0x04,0x40,0x03,0x80,0x00,0x00},/*"p",80*/

{0x00,0x00,0x03,0x80,0x04,0x40,0x04,0x50,0x07,0xF0,0x00,0x10},/*"q",81*/

{0x04,0x40,0x07,0xC0,0x02,0x40,0x04,0x00,0x04,0x00,0x00,0x00},/*"r",82*/

{0x00,0x00,0x06,0x40,0x05,0x40,0x05,0x40,0x04,0xC0,0x00,0x00},/*"s",83*/

{0x00,0x00,0x04,0x00,0x1F,0x80,0x04,0x40,0x00,0x40,0x00,0x00},/*"t",84*/

{0x04,0x00,0x07,0x80,0x00,0x40,0x04,0x40,0x07,0xC0,0x00,0x40},/*"u",85*/

{0x04,0x00,0x07,0x00,0x04,0xC0,0x01,0x80,0x06,0x00,0x04,0x00},/*"v",86*/

{0x06,0x00,0x01,0xC0,0x07,0x00,0x01,0xC0,0x06,0x00,0x00,0x00},/*"w",87*/

{0x04,0x40,0x06,0xC0,0x01,0x00,0x06,0xC0,0x04,0x40,0x00,0x00},/*"x",88*/

{0x04,0x10,0x07,0x10,0x04,0xE0,0x01,0x80,0x06,0x00,0x04,0x00},/*"y",89*/

{0x00,0x00,0x04,0x40,0x05,0xC0,0x06,0x40,0x04,0x40,0x00,0x00},/*"z",90*/

{0x00,0x00,0x00,0x00,0x04,0x00,0x7B,0xE0,0x40,0x20,0x00,0x00},/*"{",91*/

{0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xF0,0x00,0x00,0x00,0x00},/*"|",92*/

{0x00,0x00,0x40,0x20,0x7B,0xE0,0x04,0x00,0x00,0x00,0x00,0x00},/*"}",93*/

{0x40,0x00,0x80,0x00,0x40,0x00,0x20,0x00,0x20,0x00,0x40,0x00},/*"~",94*/

};

const unsigned charoled_asc2_1608[95][16]={

{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00},/*"",0*/

{0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xCC,0x00,0x0C,0x00,0x00,0x00,0x00,

0x00,0x00},/*"!",1*/

{0x00,0x00,0x08,0x00,0x30,0x00,0x60,0x00,0x08,0x00,0x30,0x00,0x60,0x00,

0x00,0x00},/*""",2*/

{0x02,0x20,0x03,0xFC,0x1E,0x20,0x02,0x20,0x03,0xFC,0x1E,0x20,0x02,0x20,

0x00,0x00},/*"#",3*/

{0x00,0x00,0x0E,0x18,0x11,0x04,0x3F,0xFF,0x10,0x84,0x0C,0x78,0x00,0x00,

0x00,0x00},/*"$",4*/

{0x0F,0x00,0x10,0x84,0x0F,0x38,0x00,0xC0,0x07,0x78,0x18,0x84,0x00,0x78,

0x00,0x00},/*"%",5*/

{0x00,0x78,0x0F,0x84,0x10,0xC4,0x11,0x24,0x0E,0x98,0x00,0xE4,0x00,0x84,

0x00,0x08},/*"&",6*/

{0x08,0x00,0x68,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00},/*"'",7*/

{0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xE0,0x18,0x18,0x20,0x04,0x40,0x02,

0x00,0x00},/*"(",8*/

{0x00,0x00,0x40,0x02,0x20,0x04,0x18,0x18,0x07,0xE0,0x00,0x00,0x00,0x00,

0x00,0x00},/*")",9*/

{0x02,0x40,0x02,0x40,0x01,0x80,0x0F,0xF0,0x01,0x80,0x02,0x40,0x02,0x40,

0x00,0x00},/*"*",10*/

{0x00,0x80,0x00,0x80,0x00,0x80,0x0F,0xF8,0x00,0x80,0x00,0x80,0x00,0x80,

0x00,0x00},/*"+",11*/

{0x00,0x01,0x00,0x0D,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00},/*",",12*/

{0x00,0x00,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,

0x00,0x80},/*"-",13*/

{0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00},/*".",14*/

{0x00,0x00,0x00,0x06,0x00,0x18,0x00,0x60,0x01,0x80,0x06,0x00,0x18,0x00,

0x20,0x00},/*"/",15*/

{0x00,0x00,0x07,0xF0,0x08,0x08,0x10,0x04,0x10,0x04,0x08,0x08,0x07,0xF0,

0x00,0x00},/*"0",16*/

{0x00,0x00,0x08,0x04,0x08,0x04,0x1F,0xFC,0x00,0x04,0x00,0x04,0x00,0x00,

0x00,0x00},/*"1",17*/

{0x00,0x00,0x0E,0x0C,0x10,0x14,0x10,0x24,0x10,0x44,0x11,0x84,0x0E,0x0C,

0x00,0x00},/*"2",18*/

{0x00,0x00,0x0C,0x18,0x10,0x04,0x11,0x04,0x11,0x04,0x12,0x88,0x0C,0x70,

0x00,0x00},/*"3",19*/

{0x00,0x00,0x00,0xE0,0x03,0x20,0x04,0x24,0x08,0x24,0x1F,0xFC,0x00,0x24,

0x00,0x00},/*"4",20*/

{0x00,0x00,0x1F,0x98,0x10,0x84,0x11,0x04,0x11,0x04,0x10,0x88,0x10,0x70,

0x00,0x00},/*"5",21*/

{0x00,0x00,0x07,0xF0,0x08,0x88,0x11,0x04,0x11,0x04,0x18,0x88,0x00,0x70,

0x00,0x00},/*"6",22*/

{0x00,0x00,0x1C,0x00,0x10,0x00,0x10,0xFC,0x13,0x00,0x1C,0x00,0x10,0x00,

0x00,0x00},/*"7",23*/

{0x00,0x00,0x0E,0x38,0x11,0x44,0x10,0x84,0x10,0x84,0x11,0x44,0x0E,0x38,

0x00,0x00},/*"8",24*/

{0x00,0x00,0x07,0x00,0x08,0x8C,0x10,0x44,0x10,0x44,0x08,0x88,0x07,0xF0,

0x00,0x00},/*"9",25*/

{0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x0C,0x03,0x0C,0x00,0x00,0x00,0x00,

0x00,0x00},/*":",26*/

{0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x06,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00},/*";",27*/

{0x00,0x00,0x00,0x80,0x01,0x40,0x02,0x20,0x04,0x10,0x08,0x08,0x10,0x04,

0x00,0x00},/*"<",28*/

{0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,

0x00,0x00},/*"=",29*/

{0x00,0x00,0x10,0x04,0x08,0x08,0x04,0x10,0x02,0x20,0x01,0x40,0x00,0x80,

0x00,0x00},/*">",30*/

{0x00,0x00,0x0E,0x00,0x12,0x00,0x10,0x0C,0x10,0x6C,0x10,0x80,0x0F,0x00,

0x00,0x00},/*"?",31*/

{0x03,0xE0,0x0C,0x18,0x13,0xE4,0x14,0x24,0x17,0xC4,0x08,0x28,0x07,0xD0,

0x00,0x00},/*"@",32*/

{0x00,0x04,0x00,0x3C,0x03,0xC4,0x1C,0x40,0x07,0x40,0x00,0xE4,0x00,0x1C,

0x00,0x04},/*"A",33*/

{0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x04,0x11,0x04,0x0E,0x88,0x00,0x70,

0x00,0x00},/*"B",34*/

{0x03,0xE0,0x0C,0x18,0x10,0x04,0x10,0x04,0x10,0x04,0x10,0x08,0x1C,0x10,

0x00,0x00},/*"C",35*/

{0x10,0x04,0x1F,0xFC,0x10,0x04,0x10,0x04,0x10,0x04,0x08,0x08,0x07,0xF0,

0x00,0x00},/*"D",36*/

{0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x04,0x17,0xC4,0x10,0x04,0x08,0x18,

0x00,0x00},/*"E",37*/

{0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x00,0x17,0xC0,0x10,0x00,0x08,0x00,

0x00,0x00},/*"F",38*/

{0x03,0xE0,0x0C,0x18,0x10,0x04,0x10,0x04,0x10,0x44,0x1C,0x78,0x00,0x40,

0x00,0x00},/*"G",39*/

{0x10,0x04,0x1F,0xFC,0x10,0x84,0x00,0x80,0x00,0x80,0x10,0x84,0x1F,0xFC,

0x10,0x04},/*"H",40*/

{0x00,0x00,0x10,0x04,0x10,0x04,0x1F,0xFC,0x10,0x04,0x10,0x04,0x00,0x00,

0x00,0x00},/*"I",41*/

{0x00,0x03,0x00,0x01,0x10,0x01,0x10,0x01,0x1F,0xFE,0x10,0x00,0x10,0x00,

0x00,0x00},/*"J",42*/

{0x10,0x04,0x1F,0xFC,0x11,0x04,0x03,0x80,0x14,0x64,0x18,0x1C,0x10,0x04,

0x00,0x00},/*"K",43*/

{0x10,0x04,0x1F,0xFC,0x10,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x0C,

0x00,0x00},/*"L",44*/

{0x10,0x04,0x1F,0xFC,0x1F,0x00,0x00,0xFC,0x1F,0x00,0x1F,0xFC,0x10,0x04,

0x00,0x00},/*"M",45*/

{0x10,0x04,0x1F,0xFC,0x0C,0x04,0x03,0x00,0x00,0xE0,0x10,0x18,0x1F,0xFC,

0x10,0x00},/*"N",46*/

{0x07,0xF0,0x08,0x08,0x10,0x04,0x10,0x04,0x10,0x04,0x08,0x08,0x07,0xF0,

0x00,0x00},/*"O",47*/

{0x10,0x04,0x1F,0xFC,0x10,0x84,0x10,0x80,0x10,0x80,0x10,0x80,0x0F,0x00,

0x00,0x00},/*"P",48*/

{0x07,0xF0,0x08,0x18,0x10,0x24,0x10,0x24,0x10,0x1C,0x08,0x0A,0x07,0xF2,

0x00,0x00},/*"Q",49*/

{0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x00,0x11,0xC0,0x11,0x30,0x0E,0x0C,

0x00,0x04},/*"R",50*/

{0x00,0x00,0x0E,0x1C,0x11,0x04,0x10,0x84,0x10,0x84,0x10,0x44,0x1C,0x38,

0x00,0x00},/*"S",51*/

{0x18,0x00,0x10,0x00,0x10,0x04,0x1F,0xFC,0x10,0x04,0x10,0x00,0x18,0x00,

0x00,0x00},/*"T",52*/

{0x10,0x00,0x1F,0xF8,0x10,0x04,0x00,0x04,0x00,0x04,0x10,0x04,0x1F,0xF8,

0x10,0x00},/*"U",53*/

{0x10,0x00,0x1E,0x00,0x11,0xE0,0x00,0x1C,0x00,0x70,0x13,0x80,0x1C,0x00,

0x10,0x00},/*"V",54*/

{0x1F,0xC0,0x10,0x3C,0x00,0xE0,0x1F,0x00,0x00,0xE0,0x10,0x3C,0x1F,0xC0,

0x00,0x00},/*"W",55*/

{0x10,0x04,0x18,0x0C,0x16,0x34,0x01,0xC0,0x01,0xC0,0x16,0x34,0x18,0x0C,

0x10,0x04},/*"X",56*/

{0x10,0x00,0x1C,0x00,0x13,0x04,0x00,0xFC,0x13,0x04,0x1C,0x00,0x10,0x00,

0x00,0x00},/*"Y",57*/

{0x08,0x04,0x10,0x1C,0x10,0x64,0x10,0x84,0x13,0x04,0x1C,0x04,0x10,0x18,

0x00,0x00},/*"Z",58*/

{0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFE,0x40,0x02,0x40,0x02,0x40,0x02,

0x00,0x00},/*"[",59*/

{0x00,0x00,0x30,0x00,0x0C,0x00,0x03,0x80,0x00,0x60,0x00,0x1C,0x00,0x03,

0x00,0x00},/*"\",60*/

{0x00,0x00,0x40,0x02,0x40,0x02,0x40,0x02,0x7F,0xFE,0x00,0x00,0x00,0x00,

0x00,0x00},/*"]",61*/

{0x00,0x00,0x00,0x00,0x20,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x20,0x00,

0x00,0x00},/*"^",62*/

{0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,

0x00,0x01},/*"_",63*/

{0x00,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x00},/*"`",64*/

{0x00,0x00,0x00,0x98,0x01,0x24,0x01,0x44,0x01,0x44,0x01,0x44,0x00,0xFC,

0x00,0x04},/*"a",65*/

{0x10,0x00,0x1F,0xFC,0x00,0x88,0x01,0x04,0x01,0x04,0x00,0x88,0x00,0x70,

0x00,0x00},/*"b",66*/

{0x00,0x00,0x00,0x70,0x00,0x88,0x01,0x04,0x01,0x04,0x01,0x04,0x00,0x88,

0x00,0x00},/*"c",67*/

{0x00,0x00,0x00,0x70,0x00,0x88,0x01,0x04,0x01,0x04,0x11,0x08,0x1F,0xFC,

0x00,0x04},/*"d",68*/

{0x00,0x00,0x00,0xF8,0x01,0x44,0x01,0x44,0x01,0x44,0x01,0x44,0x00,0xC8,

0x00,0x00},/*"e",69*/

{0x00,0x00,0x01,0x04,0x01,0x04,0x0F,0xFC,0x11,0x04,0x11,0x04,0x11,0x00,

0x18,0x00},/*"f",70*/

{0x00,0x00,0x00,0xD6,0x01,0x29,0x01,0x29,0x01,0x29,0x01,0xC9,0x01,0x06,

0x00,0x00},/*"g",71*/

{0x10,0x04,0x1F,0xFC,0x00,0x84,0x01,0x00,0x01,0x00,0x01,0x04,0x00,0xFC,

0x00,0x04},/*"h",72*/

{0x00,0x00,0x01,0x04,0x19,0x04,0x19,0xFC,0x00,0x04,0x00,0x04,0x00,0x00,

0x00,0x00},/*"i",73*/

{0x00,0x00,0x00,0x03,0x00,0x01,0x01,0x01,0x19,0x01,0x19,0xFE,0x00,0x00,

0x00,0x00},/*"j",74*/

{0x10,0x04,0x1F,0xFC,0x00,0x24,0x00,0x40,0x01,0xB4,0x01,0x0C,0x01,0x04,

0x00,0x00},/*"k",75*/

{0x00,0x00,0x10,0x04,0x10,0x04,0x1F,0xFC,0x00,0x04,0x00,0x04,0x00,0x00,

0x00,0x00},/*"l",76*/

{0x01,0x04,0x01,0xFC,0x01,0x04,0x01,0x00,0x01,0xFC,0x01,0x04,0x01,0x00,

0x00,0xFC},/*"m",77*/

{0x01,0x04,0x01,0xFC,0x00,0x84,0x01,0x00,0x01,0x00,0x01,0x04,0x00,0xFC,

0x00,0x04},/*"n",78*/

{0x00,0x00,0x00,0xF8,0x01,0x04,0x01,0x04,0x01,0x04,0x01,0x04,0x00,0xF8,

0x00,0x00},/*"o",79*/

{0x01,0x01,0x01,0xFF,0x00,0x85,0x01,0x04,0x01,0x04,0x00,0x88,0x00,0x70,

0x00,0x00},/*"p",80*/

{0x00,0x00,0x00,0x70,0x00,0x88,0x01,0x04,0x01,0x04,0x01,0x05,0x01,0xFF,

0x00,0x01},/*"q",81*/

{0x01,0x04,0x01,0x04,0x01,0xFC,0x00,0x84,0x01,0x04,0x01,0x00,0x01,0x80,

0x00,0x00},/*"r",82*/

{0x00,0x00,0x00,0xCC,0x01,0x24,0x01,0x24,0x01,0x24,0x01,0x24,0x01,0x98,

0x00,0x00},/*"s",83*/

{0x00,0x00,0x01,0x00,0x01,0x00,0x07,0xF8,0x01,0x04,0x01,0x04,0x00,0x00,

0x00,0x00},/*"t",84*/

{0x01,0x00,0x01,0xF8,0x00,0x04,0x00,0x04,0x00,0x04,0x01,0x08,0x01,0xFC,

0x00,0x04},/*"u",85*/

{0x01,0x00,0x01,0x80,0x01,0x70,0x00,0x0C,0x00,0x10,0x01,0x60,0x01,0x80,

0x01,0x00},/*"v",86*/

{0x01,0xF0,0x01,0x0C,0x00,0x30,0x01,0xC0,0x00,0x30,0x01,0x0C,0x01,0xF0,

0x01,0x00},/*"w",87*/

{0x00,0x00,0x01,0x04,0x01,0x8C,0x00,0x74,0x01,0x70,0x01,0x8C,0x01,0x04,

0x00,0x00},/*"x",88*/

{0x01,0x01,0x01,0x81,0x01,0x71,0x00,0x0E,0x00,0x18,0x01,0x60,0x01,0x80,

0x01,0x00},/*"y",89*/

{0x00,0x00,0x01,0x84,0x01,0x0C,0x01,0x34,0x01,0x44,0x01,0x84,0x01,0x0C,

0x00,0x00},/*"z",90*/

{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x3E,0xFC,0x40,0x02,

0x40,0x02},/*"{",91*/

{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,

0x00,0x00},/*"|",92*/

{0x00,0x00,0x40,0x02,0x40,0x02,0x3E,0xFC,0x01,0x00,0x00,0x00,0x00,0x00,

0x00,0x00},/*"}",93*/

{0x00,0x00,0x60,0x00,0x80,0x00,0x80,0x00,0x40,0x00,0x40,0x00,0x20,0x00,

0x20,0x00},/*"~",94*/

};

void delay_init(u8 SYSCLK)

{

SysTick->CTRL&=0xfffffffb; //bit2清空,选择外部时钟 HCLK/8

fac_us=SYSCLK/8;

fac_ms=(u16)fac_us*1000;

}

void delay_ms(u16 nms)

{

u32 temp;

SysTick->LOAD=(u32)nms*fac_ms; //时间加载(SysTick->LOAD为24bit)

SysTick->VAL =0x00; //清空计数器

SysTick->CTRL=0x01 ; //开始倒数

do{temp=SysTick->CTRL;}

while(temp&0x01&&!(temp&(1<<16))); //等待时间到达

SysTick->CTRL=0x00; //关闭计数器

SysTick->VAL =0X00; //清空计数器

}

void delay_us(u32 nus)

{

u32 temp;

SysTick->LOAD=nus*fac_us; //时间加载

SysTick->VAL=0x00; //清空计数器

SysTick->CTRL=0x01 ; //开始倒数

do{temp=SysTick->CTRL;}

while(temp&0x01&&!(temp&(1<<16))); //等待时间到达

SysTick->CTRL=0x00; //关闭计数器

SysTick->VAL =0X00; //清空计数器

}

/***********************************************

名称:LED接口初始化函数

***********************************************/

void Led_Init(void)

{

RCC->APB2ENR|=1<<3; //使能PORTB接口时钟

GPIOB->CRH&=0XFFF0FFFF;

GPIOB->CRH|=0X00030000; //PB12推挽输出

GPIOB->ODR|=1<<12; //PB12输出高电平

GPIOB->CRH&=0XFF0FFFFF;

GPIOB->CRH|=0X00300000; //PB13推挽输出

GPIOB->ODR|=1<<13; //PB13输出高电平

GPIOB->CRH&=0XF0FFFFFF;

GPIOB->CRH|=0X03000000; //PB14推挽输出

GPIOB->ODR|=1<<14; //PB14输出高电平

GPIOB->CRH&=0X0FFFFFFF;

GPIOB->CRH|=0X30000000; //PB15推挽输出

GPIOB->ODR|=1<<15; //PB15输出高电平

}

void Red_Led_Light(void){LED_RED=0;}

void Red_Led_Goout(void){LED_RED=1;}

voidGreen_Led_Light(void){LED_GREEN=0;}

voidGreen_Led_Goout(void){LED_GREEN=1;}

voidYellow_Led_Light(void){LED_YELLOW=0;}

voidYellow_Led_Goout(void){LED_YELLOW=1;}

void Blue_Led_Light(void){LED_BLUE=0;}

void Blue_Led_Goout(void){LED_BLUE=1;}

void DS18B20_Rst(void)

{

DS18B20_IO_OUT(); //SET PA0 OUTPUT

DS18B20_DQ_OUT=0; //拉低DQ

delay_us(750); //拉低750us

DS18B20_DQ_OUT=1; //DQ=1

delay_us(15); //15US

}

u8 DS18B20_Check(void)

{

u8 retry=0;

DS18B20_IO_IN(); //SET PA0 INPUT

while(DS18B20_DQ_IN&&retry<200)

{retry++;delay_us(1);};

if(retry>=200)return 1;

else retry=0;

while(!DS18B20_DQ_IN&&retry<240){retry++;delay_us(1);};

if(retry>=240)return 1;

return 0;

}

u8 DS18B20_Read_Bit(void)

{

u8 data;

DS18B20_IO_OUT();DS18B20_DQ_OUT=0;delay_us(2);

DS18B20_DQ_OUT=1;DS18B20_IO_IN();delay_us(12);

if(DS18B20_DQ_IN)data=1;

else data=0;delay_us(50);

return data;

}

u8 DS18B20_Read_Byte(void)

{

u8 i,j,dat;

dat=0;

for(i=1;i<=8;i++)

{j=DS18B20_Read_Bit();dat=(j<<7)|(dat>>1);}

return dat;

}

void DS18B20_Write_Byte(u8 dat)

{

u8 j;

u8 testb;

DS18B20_IO_OUT();

for(j=1;j<=8;j++)

{

testb=dat&0x01;

dat=dat>>1;

if(testb)

{DS18B20_DQ_OUT=0;delay_us(2);DS18B20_DQ_OUT=1;delay_us(60);}

else

{DS18B20_DQ_OUT=0;delay_us(60);DS18B20_DQ_OUT=1;delay_us(2);}

}

}

void DS18B20_Start(void)

{

DS18B20_Rst();DS18B20_Check();

DS18B20_Write_Byte(0xcc);DS18B20_Write_Byte(0x44);

}

u8 DS18B20_Init(void)

{

RCC->APB2ENR|=1<<2; //使能PORTA口时钟

GPIOA->CRL&=0XFFFFFFF0; //PORTA.0 推挽输出

GPIOA->CRL|=0X00000003;

GPIOA->ODR|=1<<0; //输出1

DS18B20_Rst();

return DS18B20_Check();

}

short DS18B20_Get_Temp(void)

{

u8 temp;u8 TL,TH;short tem;

DS18B20_Start();DS18B20_Rst();DS18B20_Check();

DS18B20_Write_Byte(0xcc);DS18B20_Write_Byte(0xbe);

TL=DS18B20_Read_Byte();TH=DS18B20_Read_Byte();

if(TH>7)

{TH=~TH;TL=~TL;temp=0;} //温度为负

else temp=1; //温度为正

tem=TH; //获得高八位

tem<<=8;

tem+=TL; //获得底八位

tem=(float)tem*0.625; //转换

if(temp)return tem; //返回温度值

else return -tem;

}

void OLED_Refresh_Gram(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(OLED_GRAM[n][i],OLED_DATA);}

}

}

void OLED_WR_Byte(u8 dat,u8 cmd)

{

u8 i;

if(cmd){OLED_RS_Set();}

else{OLED_RS_Clr();}

for(i=0;i<8;i++)

{

OLED_SCLK_Clr();

if(dat&0x80){OLED_SDIN_Set();}

else{OLED_SDIN_Clr();}

OLED_SCLK_Set();

dat<<=1;

}

OLED_RS_Set();

}

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

}

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(void)

{

u8 i,n;

for(i=0;i<8;i++)for(n=0;n<128;n++)OLED_GRAM[n][i]=0X00;

OLED_Refresh_Gram(); //更新显示

}

void OLED_DrawPoint(u8 x,u8 y,u8 t)

{

u8 pos,bx,temp=0;

if(x>127||y>63)return; //超出范围了.

pos=7-y/8;bx=y%8;temp=1<<(7-bx);

if(t)OLED_GRAM[x][pos]|=temp;

else OLED_GRAM[x][pos]&=~temp;

}

void OLED_ShowChar(u8 x,u8 y,u8 chr,u8size,u8 mode)

{

u8 temp,t,t1;u8 y0=y;

chr=chr-' '; //得到偏移后的值

for(t=0;t<size;t++)

{

if(size==12) {temp=oled_asc2_1206[chr][t];} //调用1206字体

else{temp=oled_asc2_1608[chr][t];} //调用1608字体

for(t1=0;t1<8;t1++)

{

if(temp&0x80){OLED_DrawPoint(x,y,mode);}

else{OLED_DrawPoint(x,y,!mode);}

temp<<=1;y++;

if((y-y0)==size){y=y0;x++;break;}

}

}

}

u32 oled_pow(u8 m,u8 n)

{u32 result=1;while(n--)result*=m;returnresult;}

void OLED_ShowNumber(u8 x,u8 y,u32num,u8 len,u8 size)

{

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+(size/2)*t,y,' ',size,1);continue;}

else{enshow=1;}

}

OLED_ShowChar(x+(size/2)*t,y,temp+'0',size,1);

}

}

void OLED_ShowString(u8 x,u8 y,const u8*p)

{

#define MAX_CHAR_POSX 122

#define MAX_CHAR_POSY 58

while(*p!='\0')

{

if(x>MAX_CHAR_POSX){x=0;y+=16;}

if(y>MAX_CHAR_POSY){y=x=0;OLED_Clear();}

OLED_ShowChar(x,y,*p,12,1);

x+=8;p++;

}

}

void Oled_Init(void)

{

RCC->APB2ENR|=1<<3; //使能PORTB时钟

GPIOB->CRL&=0XFFF0FFFF;

GPIOB->CRL|=0X00020000; //PB4 推挽输出

RCC->APB2ENR|=1<<4; //使能PORTC时钟

RCC->APB2ENR|=1<<0; //使能AFIO时钟

GPIOC->CRH&=0X000FFFFF; //PC13,14,15设置成输出 2MHz 推挽输出

GPIOC->CRH|=0X22200000;

PWR->CR|=1<<8; //取消备份区写保护

RCC->BDCR&=0xFFFFFFFE; //外部低俗振荡器关闭 PC14,PC15成为普通IO

BKP->CR&=0xFFFFFFFE; //侵入检测TAMPER引脚作为通用IO口使用

PWR->CR&=0xFFFFFEFF; //备份区写保护

OLED_RST_Clr();

delay_ms(100);

OLED_RST_Set();

OLED_WR_Byte(0xAE,OLED_CMD); //关闭显示

OLED_WR_Byte(0xD5,OLED_CMD); //设置时钟分频因子,震荡频率

OLED_WR_Byte(80,OLED_CMD); //[3:0],分频因子;[7:4],震荡频率

OLED_WR_Byte(0xA8,OLED_CMD); //设置驱动路数

OLED_WR_Byte(0X3F,OLED_CMD); //默认0X3F(1/64)

OLED_WR_Byte(0xD3,OLED_CMD); //设置显示偏移

OLED_WR_Byte(0X00,OLED_CMD); //默认为0

OLED_WR_Byte(0x40,OLED_CMD); //设置显示开始行 [5:0],行数

OLED_WR_Byte(0x8D,OLED_CMD); //电荷泵设置

OLED_WR_Byte(0x14,OLED_CMD); //bit2,开启/关闭

OLED_WR_Byte(0x20,OLED_CMD); //设置内存地址模式

OLED_WR_Byte(0x02,OLED_CMD);

//[1:0],00,列地址模式;01,行地址模式;10,页地址模式;默认10;

OLED_WR_Byte(0xA1,OLED_CMD); //段重定义设置,bit0:0,0->0;1,0->127;

OLED_WR_Byte(0xC0,OLED_CMD);

//设置COM扫描方向;bit3:0,普通模式;1,重定义模式 COM[N-1]->COM0;N:驱动路数

OLED_WR_Byte(0xDA,OLED_CMD); //设置COM硬件引脚配置

OLED_WR_Byte(0x12,OLED_CMD); //[5:4]配置

OLED_WR_Byte(0x81,OLED_CMD); //对比度设置

OLED_WR_Byte(0xEF,OLED_CMD); //1~255;默认0X7F (亮度设置,越大越亮)

OLED_WR_Byte(0xD9,OLED_CMD); //设置预充电周期

OLED_WR_Byte(0xf1,OLED_CMD); //[3:0],PHASE 1;[7:4],PHASE 2;

OLED_WR_Byte(0xDB,OLED_CMD); //设置VCOMH 电压倍率

OLED_WR_Byte(0x30,OLED_CMD);

//[6:4]000,0.65*vcc;001,0.77*vcc;011,0.83*vcc;

OLED_WR_Byte(0xA4,OLED_CMD);

//全局显示开启;bit0:1,开启;0,关闭;(白屏/黑屏)

OLED_WR_Byte(0xA6,OLED_CMD); //设置显示方式;bit0:1,反相显示;0,正常显示

OLED_WR_Byte(0xAF,OLED_CMD); //开启显示

OLED_Clear();

}

void Oled_Show(void)

{

OLED_ShowString(0,0,"****************");

OLED_ShowString(22,20,"18B20--TEST");

OLED_ShowString(30,30,"T: 'C");

OLED_ShowString(0,50,"****************");

OLED_Refresh_Gram();

}

int main(void)

{

short temp;u8 temp1;u8 temp2;

Stm32_Clock_Init(9); //系统时钟设置

delay_init(72); //延时初始化

JTAG_Set(JTAG_SWD_DISABLE); //关闭JTAG接口

JTAG_Set(SWD_ENABLE); //打开SWD接口

Oled_Init();

Led_Init(); //LED初始化

while(DS18B20_Init()) //初始化DS18B20,兼检测18B20

{delay_ms(1000);LED_RED = !LED_RED;}//DS0闪烁

Oled_Show();

while(1)

{

temp=DS18B20_Get_Temp();

if(temp<0){temp=-temp;}

temp1=(u8)(temp/10);temp2=(u8)(temp%10);

OLED_ShowNumber(55,30,temp1,2,12);

OLED_ShowString(68,30,".");

OLED_ShowNumber(70,30,temp2,2,12);

OLED_Refresh_Gram();

delay_ms(200);

LED_RED = !LED_RED;

}

}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/345665.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

使用Arthas定位问题

功能概述 首先&#xff0c;Arthas的常用功能大概有以下几个&#xff1a; 解决依赖冲突 sc命令&#xff1a;模糊查看当前 JVM 中是否加载了包含关键字的类&#xff0c;以及获取其完全名称。 sc -d 关键字 注意使用 sc -d 命令&#xff0c;获取 classLoaderHash命令&#xff1a…

Java 快速判断一个 IP 是否在给定的网段内

目录方法一&#xff1a;借助于 Java 提供的 InetAddress方法二&#xff1a;撸个算法实现&#xff08;二进制计算&#xff09;其他数字转为子网掩码要在Java中判断一个IP地址是否在给定的网段内&#xff0c;可以使用子网掩码将IP地址和子网掩码进行与操作来提取网络地址&#xf…

计算机网络入门

一&#xff0c;计算机网络在信息时代中的作用 21世纪的一些重要特征就是数字化&#xff0c;网络化和信息化&#xff0c;它是一个以网络为核心的信息时代。有三类大家很熟悉的网络&#xff0c;即电信网络&#xff0c;有线电视网络和计算机网络。按照最初的服务分工&#xff0c;…

GB28181-2022注册注销基本要求、注册重定向解读和技术实现

规范解读GB28181-2022注册、注销基本要求相对GB28181-2016版本&#xff0c;做了一定的调整&#xff0c;新调整的部分如下&#xff1a;——更改了注册和注销基本要求&#xff08;见 9.1.1&#xff0c;2016 年版的 9.1.1&#xff09;。1.增加对NAT模式网络传输要求&#xff0c;宜…

Vulnhub 渗透练习(一)—— Breach 1.0

环境搭建 环境下载&#xff1a; https://www.vulnhub.com/entry/breach-1,152/ 环境描述&#xff1a; Vulnhub 中对此环境的描述&#xff1a; VM 配置有静态 IP 地址 (192.168.110.140)&#xff0c;因此您需要将仅主机适配器配置到该子网。 这里我用的是 VMware &#xff0…

零信任-腾讯零信任iOA介绍(4)

​腾讯零信任介绍 腾讯零信任是一种信息安全架构&#xff0c;旨在通过限制对计算设备、数据和应用程序的访问来保护敏感信息。腾讯零信任的主要思想是&#xff0c;任何计算设备、数据或应用程序都不应被自动信任&#xff0c;并需要经过授权后才能访问敏感信息。 腾讯零信任的…

MyBatis的工作原理

1、读取MyBatis 配置文件&#xff1a;mybatis-config.xml 为MyBatis 的全局配置文件&#xff0c;配置了MyBatis 的运行环境等信息&#xff0c;例如数据库连接信息。 2、加载映射文件。映射文件即SQL 映射文件&#xff0c;该文件中配置了操作数据库的SQL 语句&#xff0c;需要在…

运动耳机买什么样的好、最好用的运动耳机排行榜

2月中旬&#xff0c;气温回暖&#xff0c;路面冰雪融化&#xff0c;又到了运动的好时节。难道还要每天上下班后就回家躺着嘛&#xff0c;浪费时间可耻&#xff0c;为什么不做一些更有意义的事情呢&#xff1f;即刻出发&#xff0c;开始空余&#xff0c;享受运动锻炼的乐趣&…

如何开发一个小游戏?其中有什么难点

如果仅仅针对个人开发者来讲&#xff0c;要独立开发一款大型游戏几乎无可能&#xff0c;更大成功的可能还是开发一款类似《羊了个羊》这样洗脑的小程序游戏。 所以这里主要论述小游戏开发的情况&#xff0c;也就是小程序游戏&#xff0c;首先从小游戏的开发流程来看&#xff1…

大数据之-Nifi-认识Nifi_Nifi的核心概念_Nifi核心架构_Nifi的性能_Nifi的关键特性---大数据之Nifi工作笔记0001

用来管理不同系统之间的信息流的工具. ETL工具 kettle是数据的转换 比如kettle来说,如果需要做ETL的数据特别大量特别多,他就会支持不了数据的转换会有崩溃的现象 可以看到nifi解决的是dataflow的问题,解决的是数据流的问题 可以看到Nifi的用处,用来处理数据的分发,是BS架构…

jenkins实现接口自动化持续集成(python+pytest+ Allure+git)

在用python做自动化测试时&#xff0c;我们写好代码&#xff0c;然后需要执行才能得到测试报告&#xff0c;这时我们可以通过 Jenkins 来进一步完成自动化工作。借助Jenkins&#xff0c;我们可以结合 Git/SVN 自动拉取代码&#xff0c;通过设置定时构建实现自动触发脚本执行&am…

1.6实验6:配置多区域OSPF

1.4.1实验6:配置多区域OSPF 实验需求实现OSPF多区域配置阐明OSPF的LSA的类型阐明OSPF引入外部路由的配置方法阐明向OSPF引入缺省路由的方法实验拓扑配置多区域OSPF如图1-16所示。 图1-16 配置多区域OSPF 实验步骤[1] IP地址配置

Seata源码学习(二)-源码入口

Seata源码剖析-源码入口 Seata客户端启动 首先一个Seata的客户端启动一般分为几个流程&#xff1a; 自动加载各种Bean及配置信息初始化TM初始化RM&#xff08;具体服务&#xff09;初始化分布式事务客户端完成&#xff0c;代理数据源连接TC&#xff08;Seata服务端&#xff…

第三部分:(主从)复合句——第二章:定语从句

若多件事不一样重要&#xff0c;连接到一块就构成了主从复合句&#xff0c;主要的事情写成主句&#xff0c;次要的事情写成从句&#xff0c;从句虽然不是主要描述的事情&#xff0c;但从句是考试常考的地方&#xff0c;从句有很多复杂的变化&#xff0c;前面需要加上一些连接词…

118.(leaflet篇)leaflet空间判断-点与geojson面图层的空间关系(turf实现)

听老人家说:多看美女会长寿 地图之家总目录(订阅之前建议先查看该博客) 文章末尾处提供保证可运行完整代码包,运行如有问题,可“私信”博主。 效果如下所示: 下面献上完整代码,代码重要位置会做相应解释 <!DOCTYPE html> <html>

【算法自由之路】 贪心算法

贪心算法 局部最右得到全局最右难点在于如何证明局部最优可以得到全局最优堆 和 排序 是贪心算法最常用的实现算法 贪心算法作为最符合自然智慧的算法&#xff0c;思路是从小部分取最优从而获得最终的最优&#xff0c;但是难得是怎样获取部分最优才能得到全局最优。 有时候我…

9个EXCEL舍入函数公式的用法和实例

用法和实例 1. ROUND ROUND函数可以将数字四舍五入到指定的小数位数。 语法&#xff1a;ROUND(number, num_digits) number&#xff1a;要四舍五入的数字。 num_digits&#xff1a;要保留的小数位数。 举例&#xff1a; ROUND(3.14159,2)&#xff0c;结果为3.14 ROUND(3.141…

如何在Excel中向下拉列表中添加条件

在Excel中向下拉列表中添加条件 创建矩阵型数据集创建下拉列表创建第一个下拉列表创建第二个下拉列表你可以使用Microsoft Excel下拉列表来显示一个简单的列表,尽管有时需要更多的控制。假设你的人员分散在四个地区:北部、南部、东部和西部。你希望按地区与人员合作,而不是与…

界面组件DevExpress Reporting v22.2 - 增强的Web报表组件UI

DevExpress Reporting是.NET Framework下功能完善的报表平台&#xff0c;它附带了易于使用的Visual Studio报表设计器和丰富的报表控件集&#xff0c;包括数据透视表、图表&#xff0c;因此您可以构建无与伦比、信息清晰的报表。DevExpress Reporting v22.2版本已正式发布&…

【LeetCode】剑指 Offer 04. 二维数组中的查找 p44 -- Java Version

题目链接&#xff1a; https://leetcode.cn/problems/er-wei-shu-zu-zhong-de-cha-zhao-lcof/ 1. 题目介绍&#xff08;04. 二维数组中的查找&#xff09; 在一个 n * m 的二维数组中&#xff0c;每一行都按照从左到右 非递减 的顺序排序&#xff0c;每一列都按照从上到下 非递…