【STM32G431RBTx】备战蓝桥杯嵌入式→省赛试题→第十四届

文章目录

    • 前言
    • 一、题目
    • 二、模块初始化
    • 三、代码实现
      • interrupt.h:
      • interrupt.c:
      • main.h:
      • main.c:
    • 四、完成效果
    • 五、总结

前言

一、题目

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

二、模块初始化

1.LCD这里不用配置,直接使用提供的资源包就行
2.KEY, 四个按键IO口都要配置,分别是PB0, PB1,PB2,PA0依次是B0,B1,B2,B3不要弄错了
3.LED:开启PC8,PC9,PD2输出模式就行了。
4.定时器:TIM3(按键消抖定时器):PSC:80-1,ARR:10000-1,TIM2CH2(PA1PWM占空比以及频率):PSC:100-1,ARR:200-1,TIM4(低高频转换时间控制,LED闪烁控制,统计数据时间控制):PSC:80-1,ARR:9999,TIM17输入捕获采集。

三、代码实现

bsp组中共有:
在这里插入图片描述

interrupt.h:

#ifndef __INTERRUPT_H__
#define __INTERRUPT_H__

#include "main.h"
#include "stdbool.h"

struct keys
{
	bool key_sta;
	unsigned char judge_sta;
	unsigned int key_time;
	bool single_flag;
	bool long_flag;
};

#endif

interrupt.c:

#include "interrupt.h"
#include "tim.h"

struct keys key[4] = {0, 0, 0, 0, 0};

extern unsigned char PA1changingFlag;
extern unsigned int PA1changingTick;
extern unsigned int PA1Fre;
extern unsigned char PA1OutputMode;
extern unsigned int N;
extern float V;
float VHregister = 0.0;
unsigned int VHcompareTick = 0;
float VLregister = 0.0;
unsigned int VLcompareTick = 0;
extern float MH;
extern float ML;
extern unsigned char LED;

void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef * htim)
{
	if(htim->Instance == TIM3)
	{
		key[0].key_sta = HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_0);
		key[1].key_sta = HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_1);
		key[2].key_sta = HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_2);
		key[3].key_sta = HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_0);
		for(unsigned char i = 0; i < 4; i++)
		{
			switch(key[i].judge_sta)
			{
				case 0:
				{
					if(key[i].key_sta == 0)
					{
						key[i].judge_sta = 1;
						key[i].key_time = 0;
					}
					break;
				}
				case 1:
				{
					if(key[i].key_sta == 0)
					{
						key[i].judge_sta = 2;
					}
					else
					{
						key[i].judge_sta = 0;
					}
					break;
				}
				case 2:
				{
					if(key[i].key_sta == 1)
					{
						key[i].judge_sta = 0;
						if(key[i].key_time <= 200)
						{
							key[i].single_flag = 1;
						}
						else if(key[i].key_time > 200)
						{
							key[i].long_flag = 1;
						}
					}
					else
					{
						key[i].key_time++;
					}
					break;
				}
			}
		}
	}
	if(htim->Instance ==TIM4)
	{
		if(PA1changingFlag == 1)
		{
			if(PA1OutputMode == LOWFRE)
			{
				PA1changingTick++;
				if(PA1changingTick % 10 == 0)
					LED ^= 0x02;
				PA1Fre += 8;
				__HAL_TIM_SET_PRESCALER(&htim2, (80000000 / 200 / PA1Fre) - 1);
				if(PA1changingTick >= 500)
				{
					PA1changingTick = 0;
					PA1changingFlag = 0;
					PA1OutputMode = HIGHFRE;
					LED &= ~(0x02);
					N++;
				}
			}
			else if(PA1OutputMode == HIGHFRE)
			{
				PA1changingTick++;
				if(PA1changingTick % 10 == 0)
					LED ^= 0x02;
				PA1Fre -= 8;
				__HAL_TIM_SET_PRESCALER(&htim2, (80000000 / 200 / PA1Fre) - 1);
				if(PA1changingTick >= 500)
				{
					PA1changingTick = 0;
					PA1changingFlag = 0;
					PA1OutputMode = LOWFRE;
					LED &= ~(0x02);
					N++;
				}
			}
		}
		if(PA1OutputMode == HIGHFRE)
		{
			if(VHcompareTick >= 200)
			{
				if((unsigned int)(VHregister * 10) == (unsigned int)(V * 10))
				{
					MH = VHregister;
					VHcompareTick = 0;
				}
			}
			else
			{
				VHcompareTick++;
				if((unsigned int)(VHregister * 10) != (unsigned int)(V * 10))
				{
					VHcompareTick = 0;
				}
			}
			VHregister = V;
		}
		else if(PA1OutputMode == LOWFRE)
		{
			if(VLcompareTick >= 200)
			{
				if((unsigned int)(VLregister * 10) == (unsigned int)(V * 10))
				{
					ML = VLregister;
					VLcompareTick = 0;
				}
			}
			else
			{
				VLcompareTick++;
				if((unsigned int)(VLregister * 10) != (unsigned int)(V * 10))
				{
					VLcompareTick = 0;
				}
			}
			VLregister = V;
		}
	}
}

/* Captured Values */
uint32_t uwIC1Value1_T17CH1 = 0;
uint32_t uwIC1Value2_T17CH1 = 0;
uint32_t uwHighCapture_T17CH1 = 0;
uint32_t uwLowCapture_T17CH1 = 0;

/* Capture index */
uint16_t uhCaptureIndex_T17CH1 = 0;

/* Frequency Value */
uint32_t uwFrequency_T17CH1 = 0;
float uwDuty_T17CH1 = 0;

void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim)
{
  if (htim->Channel == HAL_TIM_ACTIVE_CHANNEL_1)
  {
    if(uhCaptureIndex_T17CH1 == 0)
    {
      /* Get the 1st Input Capture value */
      uwIC1Value1_T17CH1 = HAL_TIM_ReadCapturedValue(htim, TIM_CHANNEL_1);
			__HAL_TIM_SET_CAPTUREPOLARITY(htim, TIM_CHANNEL_1, TIM_INPUTCHANNELPOLARITY_FALLING);
      uhCaptureIndex_T17CH1 = 1;
    }
    else if(uhCaptureIndex_T17CH1 == 1)
    {
      /* Get the 2nd Input Capture value */
      uwIC1Value2_T17CH1 = HAL_TIM_ReadCapturedValue(htim, TIM_CHANNEL_1); 
			__HAL_TIM_SET_CAPTUREPOLARITY(htim, TIM_CHANNEL_1, TIM_INPUTCHANNELPOLARITY_RISING);
      /* Capture computation */
      if (uwIC1Value2_T17CH1 > uwIC1Value1_T17CH1)
      {
        uwHighCapture_T17CH1 = (uwIC1Value2_T17CH1 - uwIC1Value1_T17CH1); 
      }
      else if (uwIC1Value2_T17CH1 < uwIC1Value1_T17CH1)
      {
        /* 0xFFFF is max TIM1_CCRx value */
        uwHighCapture_T17CH1 = ((0xFFFF - uwIC1Value1_T17CH1) + uwIC1Value2_T17CH1) + 1;
      }
      else
      {
        /* If capture values are equal, we have reached the limit of frequency
           measures */
        Error_Handler();
      }
			uhCaptureIndex_T17CH1 = 2;
			uwIC1Value1_T17CH1 = uwIC1Value2_T17CH1;
      /* Frequency computation: for this example TIMx (TIM1) is clocked by
         APB2Clk */      
//      uwFrequency_T17CH1 = 1000000 / uwDiffCapture_T17CH1;
//      uhCaptureIndex_T17CH1 = 0;
    }
		else if(uhCaptureIndex_T17CH1 == 2)
    {
			uwIC1Value2_T17CH1 = HAL_TIM_ReadCapturedValue(htim, TIM_CHANNEL_1); 
			/* Capture computation */
      if (uwIC1Value2_T17CH1 > uwIC1Value1_T17CH1)
      {
        uwLowCapture_T17CH1 = (uwIC1Value2_T17CH1 - uwIC1Value1_T17CH1); 
      }
      else if (uwIC1Value2_T17CH1 < uwIC1Value1_T17CH1)
      {
        /* 0xFFFF is max TIM1_CCRx value */
        uwLowCapture_T17CH1 = ((0xFFFF - uwIC1Value1_T17CH1) + uwIC1Value2_T17CH1) + 1;
      }
      else
      {
        /* If capture values are equal, we have reached the limit of frequency
           measures */
        Error_Handler();
      }
      uwFrequency_T17CH1 = 1000000 / (uwHighCapture_T17CH1 + uwLowCapture_T17CH1);
			uwDuty_T17CH1 = uwHighCapture_T17CH1 * 100.0 / (uwLowCapture_T17CH1 + uwHighCapture_T17CH1);
      uhCaptureIndex_T17CH1 = 0;
		}
  }
}

main.h:

/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file           : main.h
  * @brief          : Header for main.c file.
  *                   This file contains the common defines of the application.
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2024 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 */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32g4xx_hal.h"

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

/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */

/* USER CODE END ET */

/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */

/* USER CODE END EC */

/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */

/* USER CODE END EM */

/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);

/* USER CODE BEGIN EFP */

/* USER CODE END EFP */

/* Private defines -----------------------------------------------------------*/

/* USER CODE BEGIN Private defines */
#define KA ((85.0 - 10.0)/(3.0 - 1.0)) 
#define DATA 0
#define PARA 1
#define RECD 2
#define LOWFRE 0
#define HIGHFRE 1
/* USER CODE END Private defines */

#ifdef __cplusplus
}
#endif

#endif /* __MAIN_H */

main.c:

/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file           : main.c
  * @brief          : Main program body
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2024 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 "adc.h"
#include "tim.h"
#include "gpio.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "lcd.h"
#include "interrupt.h"
#include "stdio.h"
#include "badc.h"
#include "led.h"
/* 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 */
extern uint32_t uwFrequency_T17CH1;
extern float uwDuty_T17CH1;
char text[30];
extern struct keys key[4];
float R37Volt;
float PA1Duty;//(0.0%, 100.0%)
unsigned int PA1Fre = 4000; //8hz / 10ms
unsigned char PA1changingFlag;
unsigned int PA1changingTick;
unsigned char PA1OutputMode;
unsigned char DisplayMode;
unsigned int R = 1;
unsigned int K = 1;
unsigned int Rtemp = 1, Ktemp = 1;
unsigned int N = 0;
float V = 0;
float MH;
float ML;
unsigned char SettingRKIndex;
unsigned char PA1DutyLock;
unsigned char LED;
/* USER CODE END PV */

/* Private function prototypes -----------------------------------------------*/
void SystemClock_Config(void);
/* USER CODE BEGIN PFP */
void LCD_Disp(void);
void DisposeKey(void);
float DutyReturn(float R37Volt);
/* USER CODE END PFP */

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

/* 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_ADC2_Init();
  MX_TIM2_Init();
  MX_TIM17_Init();
  MX_TIM3_Init();
  MX_TIM4_Init();
  /* USER CODE BEGIN 2 */
	LCD_Init();
	LCD_Clear(Black);
	LCD_SetBackColor(Black);
	LCD_SetTextColor(White);
	HAL_TIM_IC_Start_IT(&htim17, TIM_CHANNEL_1);
	HAL_TIM_Base_Start_IT(&htim3);
	HAL_TIM_Base_Start_IT(&htim4);
	getADC(&hadc2);
	R37Volt = getADC(&hadc2) * 3.3 / 4096;
	PA1Duty = DutyReturn(R37Volt);
	__HAL_TIM_SET_COMPARE(&htim2, TIM_CHANNEL_2, (unsigned int)(PA1Duty * 2));
	HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2);
	LED_Disp(0x00);
  /* USER CODE END 2 */

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

    /* USER CODE BEGIN 3 */
		R37Volt = getADC(&hadc2) * 3.3 / 4096;
		PA1Duty = DutyReturn(R37Volt);
		V = uwFrequency_T17CH1 * 2 * 3.14 * R / (100.0 * K);
		if(PA1DutyLock == 0)
		{
			__HAL_TIM_SET_COMPARE(&htim2, TIM_CHANNEL_2, (unsigned int)(PA1Duty * 2));
		}
		DisposeKey();
		if(DisplayMode == DATA)
		{
			LED |= 0x01;
		}
		else
		{
			LED &= ~0x01;
		}
		if(PA1DutyLock == 1)
		{
			LED |= (0x01 << 2);
		}
		else
		{
			LED &= ~(0x01 << 2);
		}
		LED_Disp(LED);
		LCD_Disp();
  }
  /* USER CODE END 3 */
}

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

  /** Configure the main internal regulator output voltage
  */
  HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1);

  /** 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.PLL.PLLState = RCC_PLL_ON;
  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
  RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV3;
  RCC_OscInitStruct.PLL.PLLN = 20;
  RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
  RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV2;
  RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2;
  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_DIV1;
  RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;

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

/* USER CODE BEGIN 4 */
void DisposeKey(void)
{
	if(key[0].single_flag)
	{
		DisplayMode++;
		if(DisplayMode == RECD)
		{
			R = Rtemp;
			K = Ktemp;
		}
		else if(DisplayMode == PARA)
		{
			SettingRKIndex = 0;
		}
		DisplayMode %= 3;
		LCD_Clear(Black);
		key[0].single_flag = 0;
	}
	if(key[1].single_flag)
	{
		if(DisplayMode == DATA)
		{
			if(PA1changingFlag == 0)
			{
				PA1changingFlag = 1;
				PA1changingTick = 0;
			}
		}
		else if(DisplayMode == PARA)
		{
			SettingRKIndex = !SettingRKIndex;
		}
		key[1].single_flag = 0;
	}
	if(key[2].single_flag)
	{
		if(DisplayMode == PARA)
		{
			if(SettingRKIndex == 0)
			{
				Rtemp++;
				if(Rtemp == 11)
					Rtemp = 1;
			}
			else if(SettingRKIndex == 1)
			{
				Ktemp++;
				if(Ktemp == 11)
					Ktemp = 1;
			}
		}
		key[2].single_flag = 0;
	}
	if(key[3].single_flag)
	{
		if(DisplayMode == PARA)
		{
			if(SettingRKIndex == 0)
			{
				Rtemp--;
				if(Rtemp == 0)
					Rtemp = 10;
			}
			else if(SettingRKIndex == 1)
			{
				Ktemp--;
				if(Ktemp == 0)
					Ktemp = 10;
			}
		}
		else if(DisplayMode == DATA)
		{
			if(PA1DutyLock)
			{
				PA1DutyLock = 0;
			}
		}
		key[3].single_flag = 0;
	}
	if(key[3].long_flag)
	{
		if(DisplayMode == DATA)
		{
			PA1DutyLock = 1;
		}
		key[3].long_flag = 0;
	}
}

void LCD_Disp(void)
{
	if(DisplayMode == DATA)
	{
		LCD_DisplayStringLine(Line1, "        DATA");
		if(PA1OutputMode == HIGHFRE)
		{
			LCD_DisplayStringLine(Line3, "     M=H");
		}
		else if(PA1OutputMode == LOWFRE)
		{
			LCD_DisplayStringLine(Line3, "     M=L");
		}
		sprintf(text, "     P=%02d%%", (unsigned char)(uwDuty_T17CH1 + 0.5)); //ËÄÉáÎåÈë 
		LCD_DisplayStringLine(Line4, text);
		sprintf(text, "     V=%.1f    ", V);
		LCD_DisplayStringLine(Line5, text);
	}
	else if(DisplayMode == PARA)
	{
		LCD_DisplayStringLine(Line1, "        PARA");
		sprintf(text, "     R=%d  ", Rtemp);
		LCD_DisplayStringLine(Line3, text);
		sprintf(text, "     K=%d  ", Ktemp);
		LCD_DisplayStringLine(Line4, text);
	}
	else if(DisplayMode == RECD)
	{
		LCD_DisplayStringLine(Line1, "        RECD");
		sprintf(text, "     N=%d   ", N);
		LCD_DisplayStringLine(Line3, text);
		sprintf(text, "     MH=%.1f    ", MH);
		LCD_DisplayStringLine(Line4, text);
		sprintf(text, "     ML=%.1f    ", ML);
		LCD_DisplayStringLine(Line5, text);
	}
}

float DutyReturn(float R37Volt)
{
	float Duty = 0;
	if(R37Volt < 1.0)
	{
		Duty = 10.0;
	}
	else if(R37Volt >= 1.0 && R37Volt < 3.0)
	{
		Duty = KA * (R37Volt - 1) + 10.0;
	}
	else if(R37Volt >= 3.0)
	{
		Duty = 85.0;
	}
	return Duty;
}
/* 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 */

四、完成效果

蓝桥杯嵌入式第十四届省赛试题实现效果

五、总结

其实说本篇文章只是为了存放我的代码,所以看不懂很正常。
十四届省赛代码

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

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

相关文章

【端云一体化开发】云函数本地运行/调试启动失败的两种解决方案

最近本地调试云函数一直出现这个错误&#xff1a;Before launch task execute failed! details:java.lang.lllegalStateException: npm installfailed 这个问题的原因似乎是运行云函数的时候会重新下载 npm 及相关依赖文件&#xff0c;但是 DevEco 的 npm 模块出错导致这个步骤…

软考121-上午题-【软件工程】-敏捷方法

一、敏捷方法 敏捷开发的总体目标是通过“尽可能早地、持续地对有价值的软件的交付”使客户满意。通过在软件开发过程中加入灵活性&#xff0c;敏捷方法使用户能够在开发周期的后期增加或改变需求。 敏捷过程的典型方法有很多&#xff0c;每一种方法基于一套原则&#xff0c;这…

内核驱动更新

1.声明我们是开源的 .c 文件末尾加上 2.在Kconfig里面修改设备&#xff0c;bool&#xff08;双态&#xff09;-----》tristate&#xff08;三态&#xff09; 3.进入menuconfig修改为M 4.编译内核 make modules 也许你会看到一个 .ko 文件 5.复制到根目录文件下 在板子…

【Linux的进程篇章 - 进程终止和进程等待的理解】

Linux学习笔记---008 Linux之fork函数、进程终止和等待的理解1、fork函数1.1、什么是fork?1.2、fork的功能介绍1.3、fork函数返回值的理解1.4、fork函数的总结 2、进程的终止2.1、终止是在做什么&#xff1f;2.2、进程终止的3种情况 3、进程的终止3.1、进程终止的三种情况3.2、…

深度学习简介

深度学习简介 一、引言&#xff1a;深度学习的兴起 简短介绍深度学习的历史背景 深度学习&#xff0c;作为人工智能领域的一颗冉冉升起的新星&#xff0c;其根源可以追溯到上世纪的感知机学习算法。这种算法模拟人类的神经元行为&#xff0c;是最早期的尝试之一。然而&#x…

一天300收入打底,​一个适合任何人的创业项目!

共享旅游卡项目&#xff0c;一天300收入打底&#xff0c;一个适合任何人的创业项目&#xff01; 只要你不懒&#xff0c;生活总过得不会太差。只要你不贪&#xff0c;就算不能大富大贵&#xff0c;至少不会负债累累。 人性最难戒掉的两个字&#xff1a;一个是懒&#xff0c;另…

Web安全漏洞原理(5万字最全总结)

资料来源–安恒攻防实验室 目录 SQL注入漏洞 漏洞原理 举例说明 测试方式 数字型注入&#xff1a;字符型注入&#xff1a;搜索型注入&#xff1a; 判断注入方式如何利用漏洞 识别数据库类型注入方法&#xff08;union&#xff09; 绕过过滤方式 大小写混合替换关键字使用编码…

Java——数组练习

目录 一.数组转字符串 二.数组拷贝 三.求数组中元素的平均值 四.查找数组中指定元素(顺序查找) 五.查找数组中指定元素(二分查找) 六.数组排序(冒泡排序) 七.数组逆序 一.数组转字符串 代码示例&#xff1a; import java.util.Arrays int[] arr {1,2,3,4,5,6}; String…

Python(1):认识Python并且了解一些简单函数

文章目录 一、Python的优势及其使用场景二、Python环境的安装三、Python中的变量及其命名四、Python中的注释五、一些简单常见的函数和认识ASCII表六、Python导入模块的方式 一、Python的优势及其使用场景 优点&#xff1a; 开发效率高&#xff1a;Python具有非常强大的第三方…

工业智能终端助力工业自动化的关键

在当今数字化时代&#xff0c;工业自动化已经成为工业生产中的重要趋势。随着工业互联网的发展&#xff0c;工业智能终端作为关键技术之一&#xff0c;正在为工业自动化的实现提供了重要支持和保障。 一、工业平板电脑 工业平板电脑具备显示与交互功能&#xff0c;可满足数采、…

rust使用print控制台打印输出五颜六色的彩色红色字体

想要在控制台打印输出彩色的字体&#xff0c;可以使用一些已经封装好的依赖库&#xff0c;比如ansi_term这个依赖库&#xff0c;官方依赖库地址&#xff1a;https://crates.io/crates/ansi_term 安装依赖&#xff1a; cargo add ansi_term 或者在Cargo.toml文件中加入&#…

Meta宣布全新训推一体加速器:完全集成PyTorch 2,性能3倍提升

ChatGPT狂飙160天&#xff0c;世界已经不是之前的样子。 新建了免费的人工智能中文站https://ai.weoknow.com 新建了收费的人工智能中文站https://ai.hzytsoft.cn/ 更多资源欢迎关注 Meta 疯狂砸入数十亿美元&#xff0c;一部分招揽人才&#xff0c;一部分造芯片。 Meta 正在不…

PyQt5+Pycharm, QThread

一、创建窗体控件 untitled.ui&#xff1a; PushButton, PushButton_2, PushButton_3 lineEdit, lineEdit_2, lineEdit_3 二、编译窗体 自动生成untitled.py 三、新建py文件 myDemo.py import sys from PyQt5.QtWidgets import QApplication, QMainWindow from untitled…

第四百五十三回

文章目录 1. 问题描述2. 优化方法2.1 缩小范围2.2 替代方法 3. 示例代码4. 内容总结 我们在上一章回中介绍了"如何获取AppBar的高度"相关的内容&#xff0c;本章回中将介绍关于MediaQuery的优化.闲话休提&#xff0c;让我们一起Talk Flutter吧。 1. 问题描述 我们在…

【学习】移动端兼容性测试有什么方法及重要性

随着移动互联网的快速发展&#xff0c;移动应用程序已经成为人们日常生活中不可或缺的一部分。然而&#xff0c;由于各种移动设备的硬件和软件差异&#xff0c;移动应用程序的兼容性问题也越来越突出。因此&#xff0c;移动端兼容性测试成为了一个重要的环节&#xff0c;它可以…

超越ChatGPT,国内快速访问的强大 AI 工具 Claude

claude 3 opus面世后&#xff0c;网上盛传吊打了GPT-4。网上这几天也已经有了许多应用&#xff0c;但竟然还有很多小伙伴不知道国内怎么用gpt&#xff0c;也不知道怎么去用这个据说已经吊打了gpt-4的claude3。 今天我们想要进行的一项尝试就是—— 用claude3和gpt4&#xff0c…

Flyway Desktop 连接使用教程

&#xff01;&#xff01;&#xff01;这是到新的项目组&#xff0c;别人都配置好了&#xff0c;我只是用工具连接的教程&#xff0c;具体怎么和项目配置&#xff0c;请自行查阅。 1.下载软件 官网地址Home - Product Documentation 2.New project 3.创建Flyway工作路径 4.添…

CorelDRAW21.2.4中文最新官方和谐版下载

CorelDRAW是一款由加拿大Corel公司出品的平面设计软件&#xff0c;也被称为CDR。它是一款功能强大的矢量图形制作和排版软件&#xff0c;主要面向绘图设计师和印刷输出人员。该软件提供了矢量插图、页面布局、图片编辑和设计工具&#xff0c;广泛应用于排版印刷、矢量图形编辑及…

DELL VMWare R730 R740 R750 iDRAC配置与ESXI安装部署

VMware vCenter Server与ESXI版本兼容对照表 ESXI下载 VMware vcenter7.0许可证 Esxi7.0许可证 VSAN 7.0许可证 DELL VMWare R730 R740 R750 iDRAC配置与ESXI安装部署 vmware vcenter server 7.0 安装教程 1. 进入BIOS界面配置iDRAC网络 开机按F10&#xff0c;开机点击F10选择…

java八股——消息队列MQ

上一篇传送门&#xff1a;点我 目前只学习了RabbitMQ&#xff0c;后续学习了其他MQ后会继续补充。 MQ有了解过吗&#xff1f;说说什么是MQ&#xff1f; MQ是Message Queue的缩写&#xff0c;也就是消息队列的意思。它是一种应用程序对应用程序的通信方法&#xff0c;使得应用…