32+OLED之IIC手撕亚索七级狗牌

成品效果:

硬件配方:STM32F103C8T6 + SSD1306

软件配方:字模提取V2.1 CopyLeft By Horse2000 + STM32CubeMX + keil5

 

思路:

1.找到图片,将其转化为128*64 像素大小的二值化图片;【python实现转化】;

python代码:【在vscode 运行并转化图片即可】

from PIL import Image

def convert_to_binary(image_path):
    # 打开原始图片
    image = Image.open(image_path)
    
    # 调整图片大小为128x64像素
    image = image.resize((128, 64))
    
    # 将图片转化为灰度图像
    image = image.convert('L')
    
    # 进行二值化处理
    threshold = 127  # 阈值,可根据实际情况调整
    image = image.point(lambda p: p > threshold and 255)
    
    # 保存处理后的图片为BMP格式
    output_path = "output.bmp"
    image.save(output_path, "BMP")

    return output_path

# 用户输入需要转化的图片地址
input_path = input("请输入需要转化的图片地址:")
output_path = convert_to_binary(input_path)
print("图片转化和二值化完成,输出路径:", output_path)

转化出来不太完美,但是我们有了格式ok的图片就好办了,直接使用windows的图画工具 点一点就OK;展示一下修完的哈撒剋:

眉清目秀 有木有?! 哈哈

2.图片合格了,继续使用字模提取软件 【搜搜就有,俺就不附啦】

 复制是给后面代码来显示哈噻;

3.通过STM32CubeMX 配置iic 并生成工程文件;

 STM32CubeMX 配置iic步骤:

将ssd1306 的数据线和时钟线 插入如下图的PB7、PB6脚;当然不同的芯片/iic通道 插不同的脚就型 都是对应的;

继续:

4.使用keil5撸代码完成手撕哈撒剋!!

main.c 源代码附上:ctrl A,ctrl C , ctrl V,懂的都懂QAQ;(其他代码不用修改,因为已被STM32CubeMX初始化好了)

/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file           : main.c
  * @brief          : Main program body
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2023 STMicroelectronics.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
  */
/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "i2c.h"
#include "gpio.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */

/* USER CODE END Includes */

/* Private typedef -----------------------------------------------------------*/
/* USER CODE BEGIN PTD */

/* USER CODE END PTD */

/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */

/* Private macro -------------------------------------------------------------*/
/* USER CODE BEGIN PM */

/* USER CODE END PM */

/* Private variables ---------------------------------------------------------*/

/* USER CODE BEGIN PV */

/* USER CODE END PV */

/* Private function prototypes -----------------------------------------------*/
void SystemClock_Config(void);
/* USER CODE BEGIN PFP */

/* USER CODE END PFP */

/* Private user code ---------------------------------------------------------*/
/* USER CODE BEGIN 0 */

//HAL_StatusTypeDef HAL_I2C_Mem_Write(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress,
//                                   uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout);
/*
hi2c: 指向 I2C_HandleTypeDef 结构体的指针,包含了指定的 I2C 模块的配置信息。
DevAddress: I2C 设备的 7 位从机地址。
MemAddress: 要写入数据的 I2C 设备上的内存地址。  0x00写命令 0x40写数据
MemAddSize: 内存地址的大小。可以是以下值之一:
I2C_MEMADD_SIZE_8BIT:8 位内存地址大小。
I2C_MEMADD_SIZE_16BIT:16 位内存地址大小。
pData: 指向包含要写入的数据的缓冲区的指针。
Size: 要写入的字节数。
Timeout: 超时值,单位为毫秒。
*/

void Oled_Write_Cmd(uint8_t dataCmd)
{
	HAL_I2C_Mem_Write(&hi2c1,0x78,0x00,I2C_MEMADD_SIZE_8BIT,
										&dataCmd,1,0xff);
}
void write_data(uint8_t dataData)
{
	HAL_I2C_Mem_Write(&hi2c1,0x78,0x40,I2C_MEMADD_SIZE_8BIT,
										&dataData,1,0xff);
}


void initOled()
{
	Oled_Write_Cmd(0xAE);//--display off
	Oled_Write_Cmd(0x00);//---set low column address
	Oled_Write_Cmd(0x10);//---set high column address
	Oled_Write_Cmd(0x40);//--set start line address
	Oled_Write_Cmd(0xB0);//--set page address
	Oled_Write_Cmd(0x81); // contract control
	Oled_Write_Cmd(0xFF);//--128
	Oled_Write_Cmd(0xA1);//set segment remap
	Oled_Write_Cmd(0xA6);//--normal / reverse
	Oled_Write_Cmd(0xA8);//--set multiplex ratio(1 to 64)
	Oled_Write_Cmd(0x3F);//--1/32 duty
	Oled_Write_Cmd(0xC8);//Com scan direction
	Oled_Write_Cmd(0xD3);//-set display offset
	Oled_Write_Cmd(0x00);//
	Oled_Write_Cmd(0xD5);//set osc division
	Oled_Write_Cmd(0x80);//
	Oled_Write_Cmd(0xD8);//set area color mode off
	Oled_Write_Cmd(0x05);//
	Oled_Write_Cmd(0xD9);//Set Pre-Charge Period
	Oled_Write_Cmd(0xF1);//
	Oled_Write_Cmd(0xDA);//set com pin configuartion
	Oled_Write_Cmd(0x12);//
	Oled_Write_Cmd(0xDB);//set Vcomh
	Oled_Write_Cmd(0x30);//
	Oled_Write_Cmd(0x8D);//set charge pump enable
	Oled_Write_Cmd(0x14);//
	Oled_Write_Cmd(0xAF);//--turn on oled panel
}

void clearOled()
{
	unsigned char i,j;
	for(i=0;i<8;i++){
		Oled_Write_Cmd(0xB0+i);
		Oled_Write_Cmd(0x00);
		Oled_Write_Cmd(0x10);
		for(j=0;j<128;j++){
			write_data(0);
		}		
	}
}


unsigned char bmp_hasai[] =
{

	/*--  宽度x高度=128x64  --*/
	0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
	0xFF,0xFF,0x7F,0x7F,0x3F,0x1F,0x1F,0x0F,0x0F,0x0F,0x0F,0x07,0x07,0x07,0x05,0x01,
	0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x03,
	0x03,0x03,0x01,0x03,0x03,0x07,0x1F,0x7F,0xFE,0xFC,0xF0,0xE0,0x86,0x0E,0x3E,0xFE,
	0xFE,0x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0xE2,0x42,0xCC,0x98,0xB0,0x98,0xCC,0x66,0x22,0xF1,0x19,0x0F,0x81,
	0xC1,0xF1,0x39,0x1F,0x07,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xF0,0x70,
	0x18,0x1D,0x1D,0x1E,0x0E,0x0F,0x0F,0x0F,0x0F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x3F,
	0x3F,0x3F,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
	0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFC,0xF8,0x60,0x00,0x00,0x00,0x80,0x81,0x83,
	0x86,0x84,0x08,0x1F,0x10,0x34,0x2A,0x51,0x51,0x2A,0x24,0x10,0x1F,0x0C,0x03,0x01,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x03,0x07,0x0F,0x0F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x3F,0x3F,
	0x3F,0x1F,0x1F,0xEF,0xFF,0xFF,0xBF,0xBE,0x9E,0xDE,0xCF,0x4F,0x5F,0x5F,0x1F,0x3F,
	0xBF,0xFF,0xFF,0xFF,0x6E,0xB4,0x96,0xD2,0x9A,0xB2,0x76,0xEC,0xC8,0x30,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF9,0xF4,0xFE,0xFF,0xFF,0xF9,0xF6,
	0xF0,0xFE,0xFF,0xFC,0xF8,0xFB,0xFF,0xFF,0xFE,0xFF,0xFC,0xFF,0xFB,0xF8,0xF8,0x78,
	0x78,0x40,0x10,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x03,0x3F,0xFF,0xFF,0xFF,0xFE,0xFC,0xFD,0xFD,0xFD,0xF9,0xF9,0xFB,0xFB,
	0xFB,0xFB,0xFB,0xFB,0xFB,0xFB,0xFB,0xFB,0xFD,0xFD,0xFD,0xFF,0x9D,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
	0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x3F,0x0F,0x03,0x03,0x01,0x01,0x01,0x0E,0x78,0xC0,
	0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x20,
	0x00,0xD0,0xD0,0x00,0x38,0xFF,0xFF,0xFF,0xFF,0x1F,0xDF,0xFF,0x7F,0x1F,0xDF,0x1F,
	0x1F,0xFF,0xFF,0x6F,0xA3,0x11,0xE0,0x00,0x00,0x00,0x00,0xE0,0x20,0x90,0xF0,0x60,
	0xB1,0xD3,0xB2,0x7E,0xF8,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xC0,0xE0,0xE0,0xF0,0xF0,0xF8,0xFC,0xFF,0xE0,
	0xE0,0xCF,0xCF,0xE0,0xE0,0xFF,0xE7,0xF8,0xF8,0xFE,0xFF,0xFF,0xEF,0xE3,0xE9,0xEC,
	0xEC,0xFF,0x7F,0x2F,0x2F,0x20,0x2F,0x28,0x38,0x2C,0x37,0x11,0x0C,0x03,0x1F,0x30,
	0x6F,0x5F,0x6F,0x30,0x1F,0x8F,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00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,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
	0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
};

//遍历屏幕,写入;
void catbmp(unsigned char *bmp_kunkun)
{
	unsigned char i;
	unsigned int j;
	for(i=0;i<8;i++){
		Oled_Write_Cmd(0xB0+i);
		Oled_Write_Cmd(0x00);
		Oled_Write_Cmd(0x10);
		for(j=128*i;j<(128*(i+1));j++){
			write_data(bmp_kunkun[j]);                                                                                                                                                                                                                                                                                                                                                                                                                                           
		}		
	}

}

/* USER CODE END 0 */

/**
  * @brief  The application entry point.
  * @retval int
  */
int main(void)
{
  /* USER CODE BEGIN 1 */

  /* USER CODE END 1 */

  /* MCU Configuration--------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* USER CODE BEGIN Init */

  /* USER CODE END Init */

  /* Configure the system clock */
  SystemClock_Config();

  /* USER CODE BEGIN SysInit */

  /* USER CODE END SysInit */

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_I2C1_Init();
  /* USER CODE BEGIN 2 */
	
	//初始化oled;
	initOled();

	//设置页寻址模式
	Oled_Write_Cmd(0x20);
	Oled_Write_Cmd(0x02);


	//清空屏幕 
	clearOled();
	catbmp(bmp_kunkun);
	HAL_Delay(1000);
	
	//清空屏幕
	clearOled();
	catbmp(bmp_hasai);
	HAL_Delay(1000);
	
  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
    /* USER CODE END WHILE */

    /* USER CODE BEGIN 3 */
  }
  /* USER CODE END 3 */
}

/**
  * @brief System Clock Configuration
  * @retval None
  */
void SystemClock_Config(void)
{
  RCC_OscInitTypeDef RCC_OscInitStruct = {0};
  RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};

  /** Initializes the RCC Oscillators according to the specified parameters
  * in the RCC_OscInitTypeDef structure.
  */
  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
  RCC_OscInitStruct.HSEState = RCC_HSE_ON;
  RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1;
  RCC_OscInitStruct.HSIState = RCC_HSI_ON;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
  RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9;
  if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
  {
    Error_Handler();
  }

  /** Initializes the CPU, AHB and APB buses clocks
  */
  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
                              |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
  RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;

  if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
  {
    Error_Handler();
  }
}

/* USER CODE BEGIN 4 */

/* USER CODE END 4 */

/**
  * @brief  This function is executed in case of error occurrence.
  * @retval None
  */
void Error_Handler(void)
{
  /* USER CODE BEGIN Error_Handler_Debug */
  /* User can add his own implementation to report the HAL error return state */
  __disable_irq();
  while (1)
  {
  }
  /* USER CODE END Error_Handler_Debug */
}

#ifdef  USE_FULL_ASSERT
/**
  * @brief  Reports the name of the source file and the source line number
  *         where the assert_param error has occurred.
  * @param  file: pointer to the source file name
  * @param  line: assert_param error line source number
  * @retval None
  */
void assert_failed(uint8_t *file, uint32_t line)
{
  /* USER CODE BEGIN 6 */
  /* User can add his own implementation to report the file name and line number,
     ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
  /* USER CODE END 6 */
}
#endif /* USE_FULL_ASSERT */

其实源码里还有坤坤,不知道大家有没有发现出来坤坤的一秒钟 !

请看VCR:

STM32+OLED之IIC手撕亚索七级狗牌 【杰哥不要E过去打篮球啦】

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

配置zabbix-proxy主动式

IP地址对应关系如下&#xff1a; zabbix-server122.9.8.21zabbix-proxy122.9.4.102zabbix-agent2116.63.9.109 一、 安装zabbix-server https://blog.csdn.net/qq_50247813/article/details/132131774 二、 安装zabbix-proxy a. 安装zabbix源 rpm -Uvh https://repo.zabbix…

机器学习笔记 - 基于百度飞桨PaddleSeg的人体分割

一、简述 虽然Segment Anything用于图像分割的通用大模型看起来很酷(飞桨也提供分割一切的模型),但是个人感觉落地应用的时候心里还是更倾向于飞桨这种场景式的,因为需要用到一些人体分割的需求,所以这里主要是对飞桨高性能图像分割开发套件进行了解和使用,但是暂时不训练…

Modbus平台:协议中间件(支持Modbus TCP、RTU、ASCII)

该程序可放置外网中&#xff0c;适用于DTU长连接&#xff08;心跳包必须包含DTU&#xff0c;可以是tcp/udp&#xff09;&#xff0c;也可以在内网中&#xff0c;短连接访问设备server 支持协议&#xff1a;Modbus TCP | RTU | ASCII 连接方式&#xff1a;TcpAtive: TCP主动 | …

机器人制作开源方案 | 智能扶老助残辅助管家

作者&#xff1a;孙运通 黄善越 卢瑀 张宇峰 郑乐怡 单位&#xff1a;河海大学 指导老师&#xff1a;陆其清 人口老龄化始终是我国一个极为严峻的社会问题。独居老人和空巢老人占总人口比重日益提高&#xff1a;预计至2050年老龄人口占比将超20%&#xff0c;绝大部分城市和地…

基于单片机环境监测温湿度PM2.5系统设计

**单片机设计介绍&#xff0c;基于单片机环境监测温湿度PM2.5系统设计 文章目录 一 概要二、功能设计设计思路 三、 软件设计原理图 五、 程序六、 文章目录 一 概要 设计一个基于单片机环境监测温湿度PM2.5的系统是一个非常有意义的项目。以下是一个基本的介绍&#xff1a; …

云原生实战课大纲<2>

我们pod的数据挂载文件可以使用 pv-pvc的方式 1. 创建pv池 2. 在pv池中创建pv&#xff0c;并且设置pv的模式 3. 编写pod 写对应的pvc 申请书 就可以了这就是我们k8s中的pv和pvc 基于pv池创建pv的时候会有容量限制呢么关于配置呢&#xff0c;我们以前会有这种场景 比如说在dock…

Android Studio导入项目一直显示正在下载Gradle项目

如题&#xff0c;问题图类似如下&#xff1a; &#xff08;此图是解决以后截的&#xff0c;之前遇到问题没截图&#xff09; 解决方法 先找到你正在下载的gradle的版本是哪个 然后在链接中 ​​​​​​Gradle Distributions 找到你所对于gradle的版本&#xff0c;下载对应…

Centos7安装配置nginx

快捷查看指令 ctrlf 进行搜索会直接定位到需要的知识点和命令讲解&#xff08;如有不正确的地方欢迎各位小伙伴在评论区提意见&#xff0c;小编会及时修改&#xff09; Centos7安装配置nginx Nginx介绍 Nginx (engine x) 是一个高性能的 HTTP 和 反向代理 服务&#xff0c;也…

Spring Security 6.x 系列(6)—— 显式设置和修改登录态信息

一、前言 此篇是对上篇 Spring Security 6.x 系列&#xff08;5&#xff09;—— Servlet 认证体系结构介绍 中4.9章节显式调用SecurityContextRepository#saveContext进行详解分析。 二、设置和修改登录态 2.1 登录态存储形式 使用Spring Security框架&#xff0c;认证成功…

34 - 记一次线上SQL死锁事故:如何避免死锁?

之前我参与过一个项目&#xff0c;在项目初期&#xff0c;我们是没有将读写表分离的&#xff0c;而是基于一个主库完成读写操作。在业务量逐渐增大的时候&#xff0c;我们偶尔会收到系统的异常报警信息&#xff0c;DBA 通知我们数据库出现了死锁异常。 按理说业务开始是比较简…

业务逻辑漏洞

业务逻辑漏洞 扫描器扫不出来 漏洞包括 暴力破解任意用户/密码登陆短信/邮箱轰炸验证码绕过/爆破/重放/回传用户名/手机号枚举(用户名枚举&#xff1a;当用户登录时&#xff0c;显示用户名不存在&#xff0c;或密码不正确&#xff0c;两个其中一个不正确就称为用户名枚举)越…

MySQL系列 - 数据类型

MySQL是一种常用的关系型数据库管理系统&#xff0c;它支持多种数据类型&#xff0c;包括整数、浮点数、字符串、日期和时间等。在本文中&#xff0c;我们将介绍MySQL中常用的数据类型及其用法。 MySQL数据类型介绍&#xff1a; 1、整数类型&#xff1a; MySQL提供了多种整数…

微信小程序 老年人心血管健康知识科普系统

本系统的功能有管理员&#xff1a;个人中心&#xff0c;用户管理&#xff0c;热点信息管理&#xff0c;疾病管理&#xff0c;疾病类型管理&#xff0c;治疗管理&#xff0c;治疗类型管理&#xff0c;护理管理&#xff0c;护理类型管理&#xff0c;科普管理&#xff0c;科普类型…

Elasticsearch 线上实战问题及解决方案探讨

1、reindex相关问题 1.1 问题描述 我有 1tb 的一个大索引若干&#xff0c;要迁移到另外一个新集群去&#xff0c;有没有好办法&#xff1f;reindex好像会中断...... reindex 是不是就算设置了频率也会莫名的中断&#xff0c;而且没地方查到错误&#xff1f;1000多万的数据&…

『 Linux 』进程优先级

文章目录 什么是优先级Linux下的进程优先级PRI与NI使用top查看进程以及对进程的优先级的修改 进程优先级的其他概念竞争性与独立性并发与并行 什么是优先级 优先级,顾名思义,即在同一环境下不同单位对同一个资源的享有顺序; 一般优先级高的单位将优先占有该资源; 在进程当中进…

海翔云平台 getylist_login.do SQL 注入漏洞复现

0x01 产品简介 海翔云平台一站式整体解决方案提供商&#xff0c;业务涵盖 批发、连锁、零售行业ERP解决方案、wms仓储解决方案、电商、外勤、移动终端&#xff08;PDA、APP、小程序&#xff09;解决方案。 0x02 漏洞概述 海翔云平台getylist_login.do接口处存在SQL注入漏洞&am…

wmvcore.dll丢失怎么办?解决电脑出现wmvcore.dll丢失问题5个方法

wmvcore.dll缺失5个解决方法与wmvcore.dll丢失原因及文件介绍 引言&#xff1a; 在日常使用电脑的过程中&#xff0c;我们可能会遇到一些错误提示&#xff0c;其中之一就是wmvcore.dll缺失。wmvcore.dll是Windows Media Video编码解码相关动态链接库文件之一&#xff0c;它对…

vue3 element plus 表单验证 数组嵌套对象格式验证 动态验证等

基本结构 model 表单数据对象 rules 验证对象 prop model 的键名 <template><el-form ref"ruleFormRef" :model"ruleForm" :rules"rules"><el-form-item label"手机号" prop"mobile"><el-input v-mod…

使用opencv实现更换证件照背景颜色

1 概述 生活中经常要用到各种要求的证件照电子版&#xff0c;红底&#xff0c;蓝底&#xff0c;白底等&#xff0c;大部分情况我们只有其中一种&#xff0c;本文通过opencv实现证件照背景的颜色替换。 1.1 opencv介绍 OpenCV&#xff08;Open Source Computer Vision Librar…

Java第十二篇:连接安全版kafka(Kerberos认证)出现的问题解答

Could not find a ‘KafkaClient’ entry in the JAAS configuration 问题现象 问题原因 原因没有找到&#xff0c;怎么引起的倒是很清楚。原因就是找到不到指定路径下的kafka_client_jaas.conf文件&#xff0c;别看我的路径带了两个//&#xff0c;但没问题的&#xff0c;等同…