【51单片机】晨启科技,7针OLED显示驱动程序,STC89C52RC

文章目录

  • 原理图
  • oled.c
  • oled.h
  • main.c

原理图

在这里插入图片描述

在这里插入图片描述

sbit OLED_SCL=P4^3;//SCL-D0
sbit OLED_SDA=P4^1;//SDA-D1
sbit OLED_RES =P3^6;//RES
sbit OLED_DC =P3^7;//DC
sbit OLED_CS=P2^7; //CS

oled.c


#include "OLED.h"//******************************说明*********************************************
//OLED显存存放方式:
//	 0列 1列 2列 3列 4列   ...   ...   ...   ...   ...  127列
//0行
//1行
//2行
//3行
//4行
//5行
//6行
//7行
//******************************OLED*********************************************
//****************************定义说明*******************************************
//数组名称:ascii_0806[][6]
//数组说明:显示(ASCII)的西方文字点阵字库,点阵(字体)大小6x8
//作    者:
//******************************OLED**********************************************
unsigned char code
ascii_0806[][6] ={
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},// space-空格
{ 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00},// !
{ 0x00, 0x00, 0x07, 0x00, 0x07, 0x00},// "
{ 0x00, 0x14, 0x7f, 0x14, 0x7f, 0x14},// #
{ 0x00, 0x24, 0x2a, 0x7f, 0x2a, 0x12},// $
{ 0x00, 0x62, 0x64, 0x08, 0x13, 0x23},// %
{ 0x00, 0x36, 0x49, 0x55, 0x22, 0x50},// &
{ 0x00, 0x00, 0x05, 0x03, 0x00, 0x00},// '
{ 0x00, 0x00, 0x1c, 0x22, 0x41, 0x00},// (
{ 0x00, 0x00, 0x41, 0x22, 0x1c, 0x00},// )
{ 0x00, 0x14, 0x08, 0x3E, 0x08, 0x14},// *
{ 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08},// +
{ 0x00, 0x00, 0x00, 0xA0, 0x60, 0x00},// ,
{ 0x00, 0x08, 0x08, 0x08, 0x08, 0x08},// -
{ 0x00, 0x00, 0x60, 0x60, 0x00, 0x00},// .
{ 0x00, 0x20, 0x10, 0x08, 0x04, 0x02},// /
{ 0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E},// 0
{ 0x00, 0x00, 0x42, 0x7F, 0x40, 0x00},// 1
{ 0x00, 0x42, 0x61, 0x51, 0x49, 0x46},// 2
{ 0x00, 0x21, 0x41, 0x45, 0x4B, 0x31},// 3
{ 0x00, 0x18, 0x14, 0x12, 0x7F, 0x10},// 4
{ 0x00, 0x27, 0x45, 0x45, 0x45, 0x39},// 5
{ 0x00, 0x3C, 0x4A, 0x49, 0x49, 0x30},// 6
{ 0x00, 0x01, 0x71, 0x09, 0x05, 0x03},// 7
{ 0x00, 0x36, 0x49, 0x49, 0x49, 0x36},// 8
{ 0x00, 0x06, 0x49, 0x49, 0x29, 0x1E},// 9
{ 0x00, 0x00, 0x36, 0x36, 0x00, 0x00},// :
{ 0x00, 0x00, 0x56, 0x36, 0x00, 0x00},// ;
{ 0x00, 0x08, 0x14, 0x22, 0x41, 0x00},// <
{ 0x00, 0x14, 0x14, 0x14, 0x14, 0x14},// =
{ 0x00, 0x00, 0x41, 0x22, 0x14, 0x08},// >
{ 0x00, 0x02, 0x01, 0x51, 0x09, 0x06},// ?
{ 0x00, 0x32, 0x49, 0x59, 0x51, 0x3E},// @
{ 0x00, 0x7C, 0x12, 0x11, 0x12, 0x7C},// A
{ 0x00, 0x7F, 0x49, 0x49, 0x49, 0x36},// B
{ 0x00, 0x3E, 0x41, 0x41, 0x41, 0x22},// C
{ 0x00, 0x7F, 0x41, 0x41, 0x22, 0x1C},// D
{ 0x00, 0x7F, 0x49, 0x49, 0x49, 0x41},// E
{ 0x00, 0x7F, 0x09, 0x09, 0x09, 0x01},// F
{ 0x00, 0x3E, 0x41, 0x49, 0x49, 0x7A},// G
{ 0x00, 0x7F, 0x08, 0x08, 0x08, 0x7F},// H
{ 0x00, 0x00, 0x41, 0x7F, 0x41, 0x00},// I
{ 0x00, 0x20, 0x40, 0x41, 0x3F, 0x01},// J
{ 0x00, 0x7F, 0x08, 0x14, 0x22, 0x41},// K
{ 0x00, 0x7F, 0x40, 0x40, 0x40, 0x40},// L
{ 0x00, 0x7F, 0x02, 0x0C, 0x02, 0x7F},// M
{ 0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F},// N
{ 0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E},// O
{ 0x00, 0x7F, 0x09, 0x09, 0x09, 0x06},// P
{ 0x00, 0x3E, 0x41, 0x51, 0x21, 0x5E},// Q
{ 0x00, 0x7F, 0x09, 0x19, 0x29, 0x46},// R
{ 0x00, 0x46, 0x49, 0x49, 0x49, 0x31},// S
{ 0x00, 0x01, 0x01, 0x7F, 0x01, 0x01},// T
{ 0x00, 0x3F, 0x40, 0x40, 0x40, 0x3F},// U
{ 0x00, 0x1F, 0x20, 0x40, 0x20, 0x1F},// V
{ 0x00, 0x3F, 0x40, 0x38, 0x40, 0x3F},// W
{ 0x00, 0x63, 0x14, 0x08, 0x14, 0x63},// X
{ 0x00, 0x07, 0x08, 0x70, 0x08, 0x07},// Y
{ 0x00, 0x61, 0x51, 0x49, 0x45, 0x43},// Z
{ 0x00, 0x00, 0x7F, 0x41, 0x41, 0x00},// [
{ 0x00, 0x55, 0x2A, 0x55, 0x2A, 0x55},// 55
{ 0x00, 0x00, 0x41, 0x41, 0x7F, 0x00},// ]
{ 0x00, 0x04, 0x02, 0x01, 0x02, 0x04},// ^
{ 0x00, 0x40, 0x40, 0x40, 0x40, 0x40},// _
{ 0x00, 0x00, 0x01, 0x02, 0x04, 0x00},// '
{ 0x00, 0x20, 0x54, 0x54, 0x54, 0x78},// a
{ 0x00, 0x7F, 0x48, 0x44, 0x44, 0x38},// b
{ 0x00, 0x38, 0x44, 0x44, 0x44, 0x20},// c
{ 0x00, 0x38, 0x44, 0x44, 0x48, 0x7F},// d
{ 0x00, 0x38, 0x54, 0x54, 0x54, 0x18},// e
{ 0x00, 0x08, 0x7E, 0x09, 0x01, 0x02},// f
{ 0x00, 0x18, 0xA4, 0xA4, 0xA4, 0x7C},// g
{ 0x00, 0x7F, 0x08, 0x04, 0x04, 0x78},// h
{ 0x00, 0x00, 0x44, 0x7D, 0x40, 0x00},// i
{ 0x00, 0x40, 0x80, 0x84, 0x7D, 0x00},// j
{ 0x00, 0x7F, 0x10, 0x28, 0x44, 0x00},// k
{ 0x00, 0x00, 0x41, 0x7F, 0x40, 0x00},// l
{ 0x00, 0x7C, 0x04, 0x18, 0x04, 0x78},// m
{ 0x00, 0x7C, 0x08, 0x04, 0x04, 0x78},// n
{ 0x00, 0x38, 0x44, 0x44, 0x44, 0x38},// o
{ 0x00, 0xFC, 0x24, 0x24, 0x24, 0x18},// p
{ 0x00, 0x18, 0x24, 0x24, 0x18, 0xFC},// q
{ 0x00, 0x7C, 0x08, 0x04, 0x04, 0x08},// r
{ 0x00, 0x48, 0x54, 0x54, 0x54, 0x20},// s
{ 0x00, 0x04, 0x3F, 0x44, 0x40, 0x20},// t
{ 0x00, 0x3C, 0x40, 0x40, 0x20, 0x7C},// u
{ 0x00, 0x1C, 0x20, 0x40, 0x20, 0x1C},// v
{ 0x00, 0x3C, 0x40, 0x30, 0x40, 0x3C},// w
{ 0x00, 0x44, 0x28, 0x10, 0x28, 0x44},// x
{ 0x00, 0x1C, 0xA0, 0xA0, 0xA0, 0x7C},// y
{ 0x00, 0x44, 0x64, 0x54, 0x4C, 0x44},// z
{ 0x14, 0x14, 0x14, 0x14, 0x14, 0x14},// horiz lines};//****************************定义说明*******************************************
//数组名称:ascii_1608[][16]
//数组说明:显示(ASCII)的西方文字点阵字库,点阵(字体)大小16x16
//作    者:
//******************************OLED**********************************************
unsigned char code
ascii_1608[][16]={
{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*" ",0*/
{ 0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x30,0x00,0x00,0x00},/*"!",1*/
{ 0x00,0x10,0x0C,0x06,0x10,0x0C,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*""",2*/
{ 0x40,0xC0,0x78,0x40,0xC0,0x78,0x40,0x00,0x04,0x3F,0x04,0x04,0x3F,0x04,0x04,0x00},/*"#",3*/
{ 0x00,0x70,0x88,0xFC,0x08,0x30,0x00,0x00,0x00,0x18,0x20,0xFF,0x21,0x1E,0x00,0x00},/*"$",4*/
{ 0xF0,0x08,0xF0,0x00,0xE0,0x18,0x00,0x00,0x00,0x21,0x1C,0x03,0x1E,0x21,0x1E,0x00},/*"%",5*/
{ 0x00,0xF0,0x08,0x88,0x70,0x00,0x00,0x00,0x1E,0x21,0x23,0x24,0x19,0x27,0x21,0x10},/*"&",6*/
{ 0x10,0x16,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"'",7*/
{ 0x00,0x00,0x00,0xE0,0x18,0x04,0x02,0x00,0x00,0x00,0x00,0x07,0x18,0x20,0x40,0x00},/*"(",8*/
{ 0x00,0x02,0x04,0x18,0xE0,0x00,0x00,0x00,0x00,0x40,0x20,0x18,0x07,0x00,0x00,0x00},/*")",9*/
{ 0x40,0x40,0x80,0xF0,0x80,0x40,0x40,0x00,0x02,0x02,0x01,0x0F,0x01,0x02,0x02,0x00},/*"*",10*/
{ 0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x1F,0x01,0x01,0x01,0x00},/*"+",11*/
{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xB0,0x70,0x00,0x00,0x00,0x00,0x00},/*",",12*/
{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01},/*"-",13*/
{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00,0x00},/*".",14*/
{ 0x00,0x00,0x00,0x00,0x80,0x60,0x18,0x04,0x00,0x60,0x18,0x06,0x01,0x00,0x00,0x00},/*"/",15*/
{ 0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00},/*"0",16*/
{ 0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00},/*"1",17*/
{ 0x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00},/*"2",18*/
{ 0x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,0x00,0x18,0x20,0x20,0x20,0x11,0x0E,0x00},/*"3",19*/
{ 0x00,0x00,0xC0,0x20,0x10,0xF8,0x00,0x00,0x00,0x07,0x04,0x24,0x24,0x3F,0x24,0x00},/*"4",20*/
{ 0x00,0xF8,0x08,0x88,0x88,0x08,0x08,0x00,0x00,0x19,0x21,0x20,0x20,0x11,0x0E,0x00},/*"5",21*/
{ 0x00,0xE0,0x10,0x88,0x88,0x18,0x00,0x00,0x00,0x0F,0x11,0x20,0x20,0x11,0x0E,0x00},/*"6",22*/
{ 0x00,0x38,0x08,0x08,0xC8,0x38,0x08,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00},/*"7",23*/
{ 0x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00,0x00,0x1C,0x22,0x21,0x21,0x22,0x1C,0x00},/*"8",24*/
{ 0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x00,0x31,0x22,0x22,0x11,0x0F,0x00},/*"9",25*/
{ 0x00,0x00,0x00,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00},/*":",26*/
{ 0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x60,0x00,0x00,0x00,0x00},/*";",27*/
{ 0x00,0x00,0x80,0x40,0x20,0x10,0x08,0x00,0x00,0x01,0x02,0x04,0x08,0x10,0x20,0x00},/*"<",28*/
{ 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x00},/*"=",29*/
{ 0x00,0x08,0x10,0x20,0x40,0x80,0x00,0x00,0x00,0x20,0x10,0x08,0x04,0x02,0x01,0x00},/*">",30*/
{ 0x00,0x70,0x48,0x08,0x08,0x08,0xF0,0x00,0x00,0x00,0x00,0x30,0x36,0x01,0x00,0x00},/*"?",31*/
{ 0xC0,0x30,0xC8,0x28,0xE8,0x10,0xE0,0x00,0x07,0x18,0x27,0x24,0x23,0x14,0x0B,0x00},/*"@",32*/
{ 0x00,0x00,0xC0,0x38,0xE0,0x00,0x00,0x00,0x20,0x3C,0x23,0x02,0x02,0x27,0x38,0x20},/*"A",33*/
{ 0x08,0xF8,0x88,0x88,0x88,0x70,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x11,0x0E,0x00},/*"B",34*/
{ 0xC0,0x30,0x08,0x08,0x08,0x08,0x38,0x00,0x07,0x18,0x20,0x20,0x20,0x10,0x08,0x00},/*"C",35*/
{ 0x08,0xF8,0x08,0x08,0x08,0x10,0xE0,0x00,0x20,0x3F,0x20,0x20,0x20,0x10,0x0F,0x00},/*"D",36*/
{ 0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x20,0x23,0x20,0x18,0x00},/*"E",37*/
{ 0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x00,0x03,0x00,0x00,0x00},/*"F",38*/
{ 0xC0,0x30,0x08,0x08,0x08,0x38,0x00,0x00,0x07,0x18,0x20,0x20,0x22,0x1E,0x02,0x00},/*"G",39*/
{ 0x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x20,0x3F,0x21,0x01,0x01,0x21,0x3F,0x20},/*"H",40*/
{ 0x00,0x08,0x08,0xF8,0x08,0x08,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00},/*"I",41*/
{ 0x00,0x00,0x08,0x08,0xF8,0x08,0x08,0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,0x00},/*"J",42*/
{ 0x08,0xF8,0x88,0xC0,0x28,0x18,0x08,0x00,0x20,0x3F,0x20,0x01,0x26,0x38,0x20,0x00},/*"K",43*/
{ 0x08,0xF8,0x08,0x00,0x00,0x00,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x20,0x30,0x00},/*"L",44*/
{ 0x08,0xF8,0xF8,0x00,0xF8,0xF8,0x08,0x00,0x20,0x3F,0x00,0x3F,0x00,0x3F,0x20,0x00},/*"M",45*/
{ 0x08,0xF8,0x30,0xC0,0x00,0x08,0xF8,0x08,0x20,0x3F,0x20,0x00,0x07,0x18,0x3F,0x00},/*"N",46*/
{ 0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x10,0x20,0x20,0x20,0x10,0x0F,0x00},/*"O",47*/
{ 0x08,0xF8,0x08,0x08,0x08,0x08,0xF0,0x00,0x20,0x3F,0x21,0x01,0x01,0x01,0x00,0x00},/*"P",48*/
{ 0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x18,0x24,0x24,0x38,0x50,0x4F,0x00},/*"Q",49*/
{ 0x08,0xF8,0x88,0x88,0x88,0x88,0x70,0x00,0x20,0x3F,0x20,0x00,0x03,0x0C,0x30,0x20},/*"R",50*/
{ 0x00,0x70,0x88,0x08,0x08,0x08,0x38,0x00,0x00,0x38,0x20,0x21,0x21,0x22,0x1C,0x00},/*"S",51*/
{ 0x18,0x08,0x08,0xF8,0x08,0x08,0x18,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00},/*"T",52*/
{ 0x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00},/*"U",53*/
{ 0x08,0x78,0x88,0x00,0x00,0xC8,0x38,0x08,0x00,0x00,0x07,0x38,0x0E,0x01,0x00,0x00},/*"V",54*/
{ 0xF8,0x08,0x00,0xF8,0x00,0x08,0xF8,0x00,0x03,0x3C,0x07,0x00,0x07,0x3C,0x03,0x00},/*"W",55*/
{ 0x08,0x18,0x68,0x80,0x80,0x68,0x18,0x08,0x20,0x30,0x2C,0x03,0x03,0x2C,0x30,0x20},/*"X",56*/
{ 0x08,0x38,0xC8,0x00,0xC8,0x38,0x08,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00},/*"Y",57*/
{ 0x10,0x08,0x08,0x08,0xC8,0x38,0x08,0x00,0x20,0x38,0x26,0x21,0x20,0x20,0x18,0x00},/*"Z",58*/
{ 0x00,0x00,0x00,0xFE,0x02,0x02,0x02,0x00,0x00,0x00,0x00,0x7F,0x40,0x40,0x40,0x00},/*"[",59*/
{ 0x00,0x0C,0x30,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x06,0x38,0xC0,0x00},/*"\",60*/
{ 0x00,0x02,0x02,0x02,0xFE,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x7F,0x00,0x00,0x00},/*"]",61*/
{ 0x00,0x00,0x04,0x02,0x02,0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"^",62*/
{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},/*"_",63*/
{ 0x00,0x02,0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"`",64*/
{ 0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x19,0x24,0x22,0x22,0x22,0x3F,0x20},/*"a",65*/
{ 0x08,0xF8,0x00,0x80,0x80,0x00,0x00,0x00,0x00,0x3F,0x11,0x20,0x20,0x11,0x0E,0x00},/*"b",66*/
{ 0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x0E,0x11,0x20,0x20,0x20,0x11,0x00},/*"c",67*/
{ 0x00,0x00,0x00,0x80,0x80,0x88,0xF8,0x00,0x00,0x0E,0x11,0x20,0x20,0x10,0x3F,0x20},/*"d",68*/
{ 0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x22,0x22,0x22,0x22,0x13,0x00},/*"e",69*/
{ 0x00,0x80,0x80,0xF0,0x88,0x88,0x88,0x18,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00},/*"f",70*/
{ 0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x6B,0x94,0x94,0x94,0x93,0x60,0x00},/*"g",71*/
{ 0x08,0xF8,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20},/*"h",72*/
{ 0x00,0x80,0x98,0x98,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00},/*"i",73*/
{ 0x00,0x00,0x00,0x80,0x98,0x98,0x00,0x00,0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00},/*"j",74*/
{ 0x08,0xF8,0x00,0x00,0x80,0x80,0x80,0x00,0x20,0x3F,0x24,0x02,0x2D,0x30,0x20,0x00},/*"k",75*/
{ 0x00,0x08,0x08,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00},/*"l",76*/
{ 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x20,0x3F,0x20,0x00,0x3F,0x20,0x00,0x3F},/*"m",77*/
{ 0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20},/*"n",78*/
{ 0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00},/*"o",79*/
{ 0x80,0x80,0x00,0x80,0x80,0x00,0x00,0x00,0x80,0xFF,0xA1,0x20,0x20,0x11,0x0E,0x00},/*"p",80*/
{ 0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x0E,0x11,0x20,0x20,0xA0,0xFF,0x80},/*"q",81*/
{ 0x80,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x20,0x20,0x3F,0x21,0x20,0x00,0x01,0x00},/*"r",82*/
{ 0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x33,0x24,0x24,0x24,0x24,0x19,0x00},/*"s",83*/
{ 0x00,0x80,0x80,0xE0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x1F,0x20,0x20,0x00,0x00},/*"t",84*/
{ 0x80,0x80,0x00,0x00,0x00,0x80,0x80,0x00,0x00,0x1F,0x20,0x20,0x20,0x10,0x3F,0x20},/*"u",85*/
{ 0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x00,0x01,0x0E,0x30,0x08,0x06,0x01,0x00},/*"v",86*/
{ 0x80,0x80,0x00,0x80,0x00,0x80,0x80,0x80,0x0F,0x30,0x0C,0x03,0x0C,0x30,0x0F,0x00},/*"w",87*/
{ 0x00,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x31,0x2E,0x0E,0x31,0x20,0x00},/*"x",88*/
{ 0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x80,0x81,0x8E,0x70,0x18,0x06,0x01,0x00},/*"y",89*/
{ 0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x21,0x30,0x2C,0x22,0x21,0x30,0x00},/*"z",90*/
{ 0x00,0x00,0x00,0x00,0x80,0x7C,0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x3F,0x40,0x40},/*"{",91*/
{ 0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00},/*"|",92*/
{ 0x00,0x02,0x02,0x7C,0x80,0x00,0x00,0x00,0x00,0x40,0x40,0x3F,0x00,0x00,0x00,0x00},/*"}",93*/
{ 0x00,0x06,0x01,0x01,0x02,0x02,0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"~",94*/
};
//****************************定义说明*******************************************
//数组名称:HanZi[][32]
//数组说明:用户自定中文字库,需要用软件取模
//作    者:
//******************************OLED**********************************************
unsigned char code
HanZi[][32] = {
{0x00,0x80,0x60,0xF8,0x07,0x40,0x20,0x18,0x0F,0x08,0xC8,0x08,0x08,0x28,0x18,0x00,
0x01,0x00,0x00,0xFF,0x00,0x10,0x0C,0x03,0x40,0x80,0x7F,0x00,0x01,0x06,0x18,0x00},/*"你",0*/{0x10,0x10,0xF0,0x1F,0x10,0xF0,0x00,0x80,0x82,0x82,0xE2,0x92,0x8A,0x86,0x80,0x00,
0x40,0x22,0x15,0x08,0x16,0x61,0x00,0x00,0x40,0x80,0x7F,0x00,0x00,0x00,0x00,0x00},/*"好",1*/{0x24,0x24,0xA4,0xFE,0xA3,0x22,0x00,0x22,0xCC,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,
0x08,0x06,0x01,0xFF,0x00,0x01,0x04,0x04,0x04,0x04,0x04,0xFF,0x02,0x02,0x02,0x00},/*"科",2*/{0x10,0x10,0x10,0xFF,0x10,0x90,0x08,0x88,0x88,0x88,0xFF,0x88,0x88,0x88,0x08,0x00,
0x04,0x44,0x82,0x7F,0x01,0x80,0x80,0x40,0x43,0x2C,0x10,0x28,0x46,0x81,0x80,0x00},/*"技",3*/
//这里添加用户字模代码
};//****************************函数说明*******************************************
//函数名称:delay_ms()
//函数功能:	OLED延时函数
//参数说明:大致延时
//作    者:
//******************************OLED**********************************************
void delay_ms(unsigned int ms) {unsigned int a;while (ms) {a = 100;while (a--);ms--;}return;
}//****************************函数说明*******************************************
//函数名称:OLED_ColorTurn()
//函数功能:	反显函数
//参数说明:阳显示或阴显示。当参数i=0时,为阳显示;当参数i=1时,为阴显示
//						    阳显示:初始化OLED128x64个像素点全灭,但需要显示的像素点亮起
//						    阴显示:初始化OLED128x64个像素点全亮,但需要显示的像素点熄灭
//注    意:在OLED初始化函数OLED_Init()中,初始化设置为OLED_WrCmd(0xA6,0);
//			即阳显默认为正常显示。所以大多数情况下,需要反向显示为阴时,才需要调用本函数
//			并设定i=1,即OLED_ColorTurn(1);
//作    者:
//******************************OLED**********************************************
void OLED_ColorTurn(u8 i) {if (i == 0) {OLED_WrCmd(0xA6, 0);//阳显}if (i == 1) {OLED_WrCmd(0xA7, 0);//阴显}
}//****************************函数说明*******************************************
//函数名称:OLED_DisplayTurn()
//函数功能:	旋转显示函数
//参数说明:用于将显示的字符旋转180度。
//			当参数i=0时,为正常显示;
//			当参数i=1时,字符旋转180度显示。
//注    意:在OLED初始化函数OLED_Init()中,初始化设置为OLED_WrCmd(0xA1,0);OLED_WrCmd(0xC8,0);
//			即非反转状态为正常显示。如果显示屏的焊接排针更靠近自己,则需要使用反转显示
//			将其显示方向调转180度,需要设定i=1,即OLED_DisplayTurn(1);
//作    者:
//******************************OLED**********************************************
void OLED_DisplayTurn(u8 i) {if (i == 0) {OLED_WrCmd(0xC8, 0);//正常显示OLED_WrCmd(0xA1, 0);}if (i == 1) {OLED_WrCmd(0xC0, 0);//反转显示OLED_WrCmd(0xA0, 0);}
}//****************************函数说明*******************************************
//函数名称:OLED_WrCmd()
//函数功能:	OLED命令写入函数
//参数说明:dat为需要写入的命令,cmd为控制位
//			OLED的控制分为写命令和写数据。因为OLED数据和命令线共用一根引脚(DC--Data or Command),
//			我们向OLED发送一串数据时,它需要分清这是命令还是数据,所以我们需要控制好OLED上的DC位。
//			当DC=0,表示写命令,DC=1,表示写数据
//作    者:
//*******************************OLED********************************************
void OLED_WrCmd(u8 dat, u8 cmd) {u8 i;if (cmd)OLED_DC = 1;elseOLED_DC = 0;OLED_CS = 0;for (i = 0; i < 8; i++) {OLED_SCL = 0;if (dat & 0x80) {OLED_SDA = 1;} else {OLED_SDA = 0;}OLED_SCL = 1;dat <<= 1;}OLED_CS = 1;OLED_DC = 1;
}//****************************函数说明*******************************************
//函数名称:OLED_Set_Pos()
//函数功能:	OLED坐标设置函数
//参数说明:用于确定OLED上需要显示字符的坐标
//			x:表示列,范围0~127
//			y:表示行,范围0~63
//作    者:
//*********************************OLED*******************************************
void OLED_Set_Pos(u8 x, u8 y) {OLED_WrCmd(0xb0 + y, 0);OLED_WrCmd(((x & 0xf0) >> 4) | 0x10, 0);OLED_WrCmd((x & 0x0f), 0);
}//****************************函数说明********************************************
//函数名称:OLED_Display_On()
//函数功能:	开启OLED显示函数。用于开启OLED显示
//作    者:
//******************************OLED**********************************************
void OLED_Display_On(void) {OLED_WrCmd(0X8D, 0);  //SET DCDC命令OLED_WrCmd(0X14, 0);  //DCDC ONOLED_WrCmd(0XAF, 0);  //DISPLAY ON
}//****************************函数说明********************************************
//函数名称:OLED_Display_Off()
//函数功能:	关闭OLED显示函数。用于关闭OLED显示
//作    者:
//******************************OLED**********************************************
void OLED_Display_Off(void) {OLED_WrCmd(0X8D, 0);  //SET DCDC命令OLED_WrCmd(0X10, 0);  //DCDC OFFOLED_WrCmd(0XAE, 0);  //DISPLAY OFF
}//****************************函数说明********************************************
//函数名称:OLED_CLR()
//函数功能:	OLED清屏函数。用于清除全屏OLED显示。这里是所有像素点全灭。用阴显的注意了
//作    者:
//******************************OLED**********************************************
void OLED_CLR(void) {u8 i, n;for (i = 0; i < 8; i++) {OLED_WrCmd(0xb0 + i, 0);    //设置页地址(0~7)OLED_WrCmd(0x00, 0);      //设置显示位置—列低地址OLED_WrCmd(0x10, 0);      //设置显示位置—列高地址for (n = 0; n < 128; n++)OLED_WrCmd(0, 1);} //更新显示
}//****************************函数说明********************************************
//函数名称:OLED_ShowChar()
//函数功能:	OLED单字符显示函数
//参数说明:OLED在对应坐标显示一个字符。
//			x:表示列,范围0~127
//			y:表示行,范围0~63
//			sizey:表示字体大小,可以选择6x8(sizey=8)或8x16(sizey=16)大小。
//作    者:
//*********************************OLED*******************************************
void OLED_ShowChar(u8 x, u8 y, u8 chr, u8 sizey) {u8 c = 0, sizex = sizey / 2;u16 i = 0, size1;if (sizey == 8)size1 = 6;else size1 = (sizey / 8 + ((sizey % 8) ? 1 : 0)) * (sizey / 2);c = chr - ' ';//得到偏移后的值OLED_Set_Pos(x, y);for (i = 0; i < size1; i++) {if (i % sizex == 0 && sizey != 8) OLED_Set_Pos(x, y++);if (sizey == 8) OLED_WrCmd(ascii_0806[c][i], 1);//6X8字号else if (sizey == 16) OLED_WrCmd(ascii_1608[c][i], 1);//8x16字号
//		else if(sizey==xx) OLED_WrCmd(ascii_xxxx[c][i],1);//用户添加字号else return;}
}//m^n函数
u32 oled_pow(u8 m, u8 n) {u32 result = 1;while (n--)result *= m;return result;
}//****************************函数说明********************************************
//函数名称:OLED_ShowNum()
//函数功能:	OLED显示数字(串)函数
//参数说明:OLED从对应坐标开始显示数字(串)。
//			x:表示列,范围0~127
//			y:表示行,范围0~63
//			num:表示需要显示的数字大小
//			len:表示需要显示的最大数字长度	【注意:假设要显示1234时,len=3,则只会显示“234”】
//					  【注意:假设要显示4时,len=3,则会显示“  4”,注意4前面有两个数字位空出】
//			sizey:表示字体大小,可以选择6x8(sizey=8)或8x16(sizey=16)大小。
//作    者:
//*********************************OLED*******************************************
void OLED_ShowNum(u8 x, u8 y, u32 num, u8 len, u8 sizey) {u8 t, temp, m = 0;u8 enshow = 0;if (sizey == 8)m = 2;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 + (sizey / 2 + m) * t, y, ' ', sizey);continue;} else enshow = 1;}OLED_ShowChar(x + (sizey / 2 + m) * t, y, temp + '0', sizey);}
}//****************************函数说明********************************************
//函数名称:OLED_ShowString()
//函数功能:	OLED显示字符串函数
//参数说明:OLED从对应坐标开始显示数字(串)。
//			x:表示列,范围0~127
//			y:表示行,范围0~63
//			*chr:指针,指向所需显示的字符串,字符串请使用双引号引起来
//			sizey:表示字体大小,可以选择6x8(sizey=8)或8x16(sizey=16)大小。
//作    者:
//*********************************OLED*******************************************
void OLED_ShowString(u8 x, u8 y, u8 *chr, u8 sizey) {u8 j = 0;while (chr[j] != '\0') {OLED_ShowChar(x, y, chr[j++], sizey);if (sizey == 8)x += 6;else x += sizey / 2;}
}//*********************************OLED*******************************************
void OLED_ShowChinese(u8 x, u8 y, u8 no, u8 sizey) {u16 i, size1 = (sizey / 8 + ((sizey % 8) ? 1 : 0)) * sizey;for (i = 0; i < size1; i++) {if (i % sizey == 0) OLED_Set_Pos(x, y++);if (sizey == 16) OLED_WrCmd(HanZi[no][i], 1);//16x16字号
//		else if(sizey==xx) OLED_WrCmd(xxx[c][i],1);//用户添加字号else return;}
}//****************************函数说明********************************************
//函数名称:OLED_DrawBMP()
//函数功能:	OLED显示图片函数
//参数说明:OLED从对应坐标开始显示设定长宽的图片。
//			x:表示列,范围0~127
//			y:表示行,范围0~63
//			sizex:长度,最长128
//			sizey:宽度,最宽64
//作    者:
//*********************************OLED*******************************************
void OLED_DrawBMP(u8 x, u8 y, u8 sizex, u8 sizey, u8 BMP[]) {u16 j = 0;u8 i, m;sizey = sizey / 8 + ((sizey % 8) ? 1 : 0);for (i = 0; i < sizey; i++) {OLED_Set_Pos(x, i + y);for (m = 0; m < sizex; m++) {OLED_WrCmd(BMP[j++], 1);}}
}//****************************函数说明********************************************
//函数名称:OLED_Init()
//函数功能:	OLED初始化函数
//说    明:用于初始化OLED//作    者:
//*********************************OLED*******************************************
void OLED_Init(void) {OLED_RES = 0;delay_ms(200);OLED_RES = 1;OLED_WrCmd(0xAE, 0);//--turn off oled panel-关OLED屏幕OLED_WrCmd(0x00, 0);//---set low column address-设置低位地址OLED_WrCmd(0x10, 0);//---set high column address-设置高位地址OLED_WrCmd(0x40,0);//--set start line address  Set Mapping RAM Display Start Line (0x00~0x3F)-设置起始行地址和映射RAM显示起始行(0x00~0x3F)OLED_WrCmd(0x81, 0);//--set contrast control register-设置对比控制寄存器OLED_WrCmd(0xCF, 0);// Set SEG Output Current Brightness-设置输出电流OLED_WrCmd(0xA1, 0);//--Set SEG/Column Mapping-设置SEG/列映射     	 0xa0左右反置 0xa1正常OLED_WrCmd(0xC8, 0);//Set COM/Row Scan Direction-设置COM/行扫描方向   0xc0上下反置 0xc8正常OLED_WrCmd(0xA6, 0);//--set normal display-设置正常显示(阳显)OLED_WrCmd(0xA8, 0);//--set multiplex ratio(1 to 64) 设置多路复用比率OLED_WrCmd(0x3f, 0);//--1/64 dutyOLED_WrCmd(0xD3, 0);//-set display offset	Shift Mapping RAM Counter (0x00~0x3F)-设置显示偏移移位映射RAM计数器(0OLED~0x3F)OLED_WrCmd(0x00, 0);//-not offset-不偏移OLED_WrCmd(0xd5, 0);//--set display clock divide ratio/oscillator frequency-设置显示时钟分频比/振荡器频率OLED_WrCmd(0x80, 0);//--set divide ratio, Set Clock as 100 Frames/Sec-设置分频比,将时钟设置为100帧/秒OLED_WrCmd(0xD9, 0);//--set pre-charge period-设置预充电周期OLED_WrCmd(0xF1, 0);//Set Pre-Charge as 15 Clocks & Discharge as 1 Clock	   将预充电设置为15个时钟,放电为1个时钟OLED_WrCmd(0xDA, 0);//--set com pins hardware configuration-设置com引脚硬件配置OLED_WrCmd(0x12, 0);OLED_WrCmd(0xDB, 0);//--set vcomhOLED_WrCmd(0x40, 0);//Set VCOM Deselect LevelOLED_WrCmd(0x20, 0);//-Set Page Addressing Mode (0x00/0x01/0x02)-设置页面地址模式OLED_WrCmd(0x02, 0);//OLED_WrCmd(0x8D, 0);//--set Charge Pump enable/disableOLED_WrCmd(0x14, 0);//--set(0x10) disableOLED_WrCmd(0xA4, 0);// Disable Entire Display On (0xa4/0xa5)OLED_WrCmd(0xA6, 0);// Disable Inverse Display On (0xa6/a7)OLED_CLR();           //清屏OLED_WrCmd(0xAF, 0); /*display ON*///打开OLED屏幕
}

oled.h

#ifndef __OLED_H
#define __OLED_H#include "STC89C5xRC.h"#define  u8 unsigned char
#define  u16 unsigned int
#define  u32 unsigned int	 //注意,此处定义和u16一样用于节省代码占用空间
//如果OLED_ShowNum()函数需要装下更大的数,则请改此处的数据定义类型/*口袋板OLED电路引脚定义*/
sbit OLED_SCL=P4^3;//SCL-D0
sbit OLED_SDA=P4^1;//SDA-D1
sbit OLED_RES =P3^6;//RES
sbit OLED_DC =P3^7;//DC
sbit OLED_CS=P2^7; //CS/*Proteus仿真引脚定义*/
//sbit OLED_SCL=P1^4;//SCL-D0
//sbit OLED_SDA=P1^3;//SDA-D1
//sbit OLED_RES =P1^2;//RES
//sbit OLED_DC =P1^1;//DC
//sbit OLED_CS=P1^0; //CS//OLED控制用函数
void delay_ms(unsigned int ms);
void OLED_ColorTurn(u8 i);
void OLED_DisplayTurn(u8 i);
void OLED_WrCmd(u8 dat,u8 cmd);
void OLED_Set_Pos(u8 x, u8 y);
void OLED_Display_On(void);
void OLED_Display_Off(void);
void OLED_CLR(void);
void OLED_ShowChar(u8 x,u8 y,u8 chr,u8 sizey);
u32 oled_pow(u8 m,u8 n);
void OLED_ShowNum(u8 x,u8 y,u32 num,u8 len,u8 sizey);
void OLED_ShowString(u8 x,u8 y,u8 *chr,u8 sizey);
void OLED_ShowChinese(u8 x,u8 y,u8 no,u8 sizey);
void OLED_DrawBMP(u8 x,u8 y,u8 sizex, u8 sizey,u8 BMP[]);
void OLED_Init(void);#endif

main.c


#include "STC89C5xRC.h"	 //STC89C52RC的头文件
#include "OLED.h"		 //OLED显示头文件
//#include "Codedat.h"	 //图片取模头文件。将图片取模后,放入该头文件用于显示sbit beep = P2^4;		 //蜂鸣器引脚
/*******************************************************************************
* 函 数 名       : main
* 函数功能		 : 主函数
* 输    入       : 无
* 输    出    	 : 无
*******************************************************************************/
int main(void)
{beep=0;			//蜂鸣器不响OLED_Init();	//初始化OLEDOLED_ShowChinese(31,0,0,16);//“晨”。从第0+1行,第31+1列开始,显示对应位置号0的汉字,字体大小16x16OLED_ShowChinese(47,0,1,16);//“启”。从第1+1行,第47+1列开始,显示对应位置号1的汉字,字体大小16x16OLED_ShowChinese(63,0,2,16);//“科”OLED_ShowChinese(79,0,3,16);//“技”OLED_ShowString(0,2,"asd1234",16);while(1)	//while中不进行任何显示显示操作更新,那么OLED就会一直显示上面的“科技” ,不会刷新。{}
}

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

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

相关文章

如何维护你的电脑:打造IT人的重要武器

文章目录 方向一&#xff1a;介绍我的电脑方向二&#xff1a;介绍我的日常维护措施1. 定期清理和优化2. 保持良好的上网习惯和安全防护3. 合理安排软件和硬件的使用4. 数据备份和系统还原 方向三&#xff1a;推荐的维护技巧1. 数据分区和多系统安装2. 内部清洁和散热优化3. 安全…

war包方式安装linux和windows的geoserver

注意&#xff1a; 从Java 9开始&#xff0c;Oracle已经不再单独提供JRE&#xff08;Java Runtime Environment&#xff09;了&#xff0c;而是直接将JRE集成在JDK&#xff08;Java Development Kit&#xff09;中。这是因为JRE包含了运行Java程序所需的环境&#xff0c;而JDK除…

图解java.util.concurrent并发包源码系列——深入理解ReentrantLock,看完可以吊打面试官

图解java.util.concurrent并发包源码系列——深入理解ReentrantLock&#xff0c;看完可以吊打面试官 ReentrantLock是什么&#xff0c;有什么作用ReentrantLock的使用ReentrantLock源码解析ReentrantLock#lock方法FairSync#tryAcquire方法NonfairSync#tryAcquire方法 Reentrant…

(7.28-8.3)【大数据新闻速递】《数字孪生工业软件白皮书》、《中国绿色算力发展研究报告》发布;华为ChatGPT要来了

【数字孪生工业软件白皮书&#xff08;2023&#xff09;】 近日&#xff0c;第七届数字孪生与智能制造服务学术会议成功举行&#xff0c;2023《数字孪生工业软件白皮书》在会上正式发布。《白皮书》在《Digital Twin》国际期刊专家顾问委员会指导下&#xff0c;由国家重点研发计…

uC-OS2 V2.93 STM32L476 移植:环境搭建篇

前言 uC-OS2 是比较经典的 RTOS&#xff0c;如今软件授权已经改为 Apache License Version 2.0&#xff0c;意味着可以免费商用了 当前 uC-OS2 的最新版本是&#xff1a; V2.93&#xff0c;打算研究一下 RTOS 的设计思想&#xff0c;所以想在已有的开发板&#xff1a;NUCLEO-L…

棱镜七彩正式加入龙蜥社区安全联盟(OASA)

近日&#xff0c;龙蜥社区安全联盟&#xff08;OASA&#xff09;正式成立&#xff0c;棱镜七彩成为该联盟成员单位。 龙蜥社区安全联盟是促进产业合作的非营利组织&#xff0c;致力于打造中立开放、聚焦操作系统信息安全的交流平台&#xff0c;推进龙蜥社区乃至整个产业安全生态…

垃圾回收机制和常用的算法

一.什么是垃圾回收&#xff1f; 垃圾回收主要针对堆和方法区&#xff08;非堆&#xff09;,程序计数器&#xff0c;虚拟机栈&#xff0c;本地方法栈这三个区域属于线程私有&#xff0c;随着线程的销毁&#xff0c;自然就会雄安会了&#xff0c;因此不需要堆着三个区域进行垃圾…

Redis BigKey案例

面试题&#xff1a; 阿里广告平台&#xff0c;海量数据里查询某一固定前缀的key小红书&#xff0c;你如何生产上限制keys*/flushdb/flushall等危险命令以防止误删误用&#xff1f;美团&#xff0c;MEMORY USAGE命令你用过吗&#xff1f;BigKey问题&#xff0c;多大算big&#…

服务器流量

1.服务器流量分为入流量和出流量 入流量&#xff08;Inbound Traffic&#xff09;是指流向服务器的数据流量&#xff0c;也就是客户端发送到服务器的数据。这些数据可能包括请求信息、文件上传等。 出流量&#xff08;Outbound Traffic&#xff09;是指从服务器流向客户端的数…

纯css实现九宫格图片

本篇文章所分享的内容主要涉及到结构伪类选择器&#xff0c;不熟悉的小伙伴可以了解一下&#xff0c;在常用的css选择器中我也有分享相关内容。 话不多说&#xff0c;接下来我们直接上代码&#xff1a; <!DOCTYPE html> <html lang"en"><head>&l…

matlab使用教程(8)—绘制三维曲面图

1网格图和曲面图 MATLAB 在 x-y 平面中的网格上方使用点的 z 坐标来定义曲面图&#xff0c;并使用直线连接相邻的点。mesh 和surf 函数以三维形式显示曲面图。 • mesh 生成仅使用颜色来标记连接定义点的线条的线框曲面图。 • surf 使用颜色显示曲面图的连接线和面。 MATL…

实战:Prometheus+Grafana监控Linux服务器及Springboot项目

文章目录 前言知识积累什么是Prometheus什么是Grafana怎样完成数据采集和监控 环境搭建docker与docker-compose安装docker-compose编写 监控配置grafana配置prometheus数据源grafana配置dashboardLinux Host Metrics监控Spring Boot 监控 写在最后 前言 相信大家都知道一个项目…

19、springboot引用配置属性或引用生成文件的属性或引用随机值

引用配置属性或引用生成文件的属性或引用随机值 ★ 使用占位符引用其他配置属性&#xff1a; 配置文件中可用${}占位符引用已有的属性&#xff0c;被引用的属性可以是&#xff1a; - 已定义的属性。 - 来自其他配置源&#xff08;比如命令行的选项参数、环境变量、系统属性等…

SpringBoot项目上传至服务器

1.服务器安装JDK1.8 通过包管理器安装 2.服务器安装数据库 参考链接&#xff1a; CentOS 7 通过 yum 安装 MariaDB - 知乎 1. 安装之后没有密码&#xff0c;所以需要设置密码&#xff0c;使用下面的语句 set password for rootlocalhost password(111111); 2.在数据库中建…

07_Vue生命周期

Vue3生命周期 配置项的方式写Vue3生命周期 组合式API的方式写生命周期&#xff1a;写在setup里 如果同时用两种方式写生命周期钩子函数&#xff0c;组合式API里边的生命周期要比用配置项写的快一点。 注意&#xff1a;一般用一种方式即可。

自建类ChatGPT服务:本地化部署与远程访问教程

&#x1f337;&#x1f341; 博主猫头虎 带您 Go to New World.✨&#x1f341; &#x1f984; 博客首页——猫头虎的博客&#x1f390; &#x1f433;《面试题大全专栏》 文章图文并茂&#x1f995;生动形象&#x1f996;简单易学&#xff01;欢迎大家来踩踩~&#x1f33a; &a…

【python】绘图代码模板

【python】绘图代码模板 pandas.DataFrame.plot( )画图函数Seaborn绘图 -数据可视化必备主题样式导入数据集可视化统计关系散点图抖动图箱线图小提琴图Pointplot群图 可视化数据集的分布绘制单变量分布柱状图直方图 绘制双变量分布Hex图KDE 图可视化数据集中的成对关系 好看的图…

Python web实战之Django用户认证详解

关键词&#xff1a; Python Web 开发、Django、用户认证、实战案例 概要 今天来探讨一下 Django 的用户认证吧&#xff01;在这篇文章中&#xff0c;我将为大家带来一些有关 Django 用户认证的最佳实践。 1. Django 用户认证 在开发 Web 应用程序时&#xff0c;用户认证是一个…

【ARM64 常见汇编指令学习 13 -- ARM 汇编 ORG 伪指令学习】

文章目录 ARM ORG 指令介绍UEFI 中对 ORG 指令的使用 ARM ORG 指令介绍 在ARM汇编中&#xff0c;"org"是一个汇编器伪指令&#xff0c;用于设置下一条指令的装入地址。"org"后面跟着的是一个表达式&#xff0c;这个表达式的值就是下一条指令的装入地址。如…

记录--基于css3写出的流光登录(注释超详细!)

这里给大家分享我在网上总结出来的一些知识&#xff0c;希望对大家有所帮助 完整效果 对基本的表单样式进行设置 这里设置了基本的表单样式&#xff0c;外层用了div进行包裹&#xff0c;重点是运用了两个i元素在后期通过css样式勾画出一条线没在聚焦文本框的时候线会过度成一个…