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

news2024/11/29 12:35:20

文章目录

    • 前言
    • 一、题目
    • 二、模块初始化
    • 三、代码实现
      • 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 */

四、完成效果

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

五、总结

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

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

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

相关文章

看了下雷军的两份个人简历,的确厉害。。。

最近在网上浏览信息时&#xff0c;偶然看到了雷军的两份简历&#xff0c;一份是详细的工作履历&#xff0c;另一份则是他的干部履历表。 从大学时期开始&#xff0c;雷军就展现出了非凡的才华和毅力。高考成绩惊人&#xff0c;仅仅丢了2分&#xff0c;堪称完美&#xff0c;被武…

Linux网络名称空间和虚拟机有何区别

在Linux系统中&#xff0c;网络名称空间和虚拟机都是实现资源隔离和虚拟化的技术&#xff0c;但它们在设计理念、实现机制、资源消耗、使用场景等方面存在着显著的区别。本文旨在全方位、系统性地分析这两种技术的区别。&#x1f50d; 1. 设计理念与实现机制 1.1. 网络名称空…

Qt Creator 12.0.2 debug 无法查看变量的值 Expression too Complex

鼠标放在局部变量上提示“expression too complex”。 在调试窗口也看不到局部变量的值。 这应该是qt的一个bug&#xff0c;https://bugreports.qt.io/browse/QTCREATORBUG-24180 暂时解决方法&#xff1a; 如下图&#xff0c;需要右键项目然后执行"Clean"和&quo…

LeetCode第十六题: 掌握双指针技巧 最接近的三数之和 【python】

&#x1f464;作者介绍&#xff1a;10年大厂数据\经营分析经验&#xff0c;现任大厂数据部门负责人。 会一些的技术&#xff1a;数据分析、算法、SQL、大数据相关、python 欢迎加入社区&#xff1a;码上找工作http://t.csdnimg.cn/Q59WX 作者专栏每日更新&#xff1a; LeetCode…

ssm038汽车养护管理系统+jsp

汽车养护管理系统设计与实现 摘 要 现代经济快节奏发展以及不断完善升级的信息化技术&#xff0c;让传统数据信息的管理升级为软件存储&#xff0c;归纳&#xff0c;集中处理数据信息的管理方式。本汽车养护管理系统就是在这样的大环境下诞生&#xff0c;其可以帮助管理者在短…

QT实现客户端断开连接

Widget.cpp #include "widget.h" #include "ui_widget.h"Widget::Widget(QWidget *parent): QWidget(parent), ui(new Ui::Widget), socket(new QTcpSocket(this)) {ui->setupUi(this);//初始化界面ui->msgEdit->setEnabled(false); //不可用ui-…

PTA 应急救援站选址(floyd+打印路径)

大学城虎溪社区有很多居民小区&#xff0c;居民小区道路图是连通的。现要在该社区新建一个应急救援站&#xff0c;且该应急救援站要和某个小区建在一起。为了使应急救援最快速&#xff0c;经各部门商量决定&#xff1a;应急救援站建好后&#xff0c;离应急救援站最远的小区到应…

【SpringBoot整合系列】SpringBoot整合FastDFS(二)

目录 SpringBoot整合FastDFSJava客户端/依赖常用api接口解释1.uploadFile参数返回值 2.uploadSlaveFile参数返回值 3.getMetadata参数返回值 4.overwriteMetadata参数&#xff1a;返回值&#xff1a;无 5.mergeMetadata参数&#xff1a;返回值&#xff1a;无 6.queryFileInfo参…

数学之光照亮AI之路:探究数学背景在人工智能学习中的优势

在科技日新月异的今天&#xff0c;人工智能&#xff08;AI&#xff09;已成为引领未来发展的重要力量。然而&#xff0c;对于许多初涉此领域的学习者来说&#xff0c;AI的复杂性和深度常常让他们望而却步。有趣的是&#xff0c;那些数学基础扎实的人在学习AI时&#xff0c;往往…

【Docker】docker快速安装部署fastdfs的镜像详细记录

部署nacos的docker镜像 第一步&#xff1a; 获取fastdfs镜像1、查看镜像列表2、创建本地映射文件夹 第二步&#xff1a;运行镜像1.使用docker镜像构建tracker服务2.使用docker镜像构建Storage服务3.Storage服务中默认安装了Nginx服务4.如果需要修改storage则配置则进到以下目录…

Python 全栈体系【四阶】(二十八)

第五章 深度学习 四、TensorFlow 1. Tensorflow 简介 1.1 什么是 Tensorflow TensorFlow 由谷歌人工智能团队谷歌大脑&#xff08;Google Brain&#xff09;开发和维护的开源深度学习平台&#xff0c;是目前人工智能领域主流的开发平台&#xff0c;在全世界有着广泛的用户群…

【电子通识】热风枪的结构与使用方法

热风枪的结构 热风枪是专门用来拆焊、焊接贴片元器件和贴片集成电路的焊接工具&#xff0c;它主要由主机和热风焊枪两大部分构成。 热风枪主要有电源开关、风速设置、温度设置、热风连接等部件组成。根据不同品牌和价位的热风枪&#xff0c;有一些功能齐全的也集成了烙铁功能。…

vivado 设置 ILA 核以执行测量

设置 ILA 核以执行测量 您添加到自己的设计中的 ILA 核会显示在“硬件 (Hardware) ”窗口中的目标器件下。如果未显示这些 ILA 核 &#xff0c; 请右键 单击器件并选择“ Refresh Device ”。这样将重新扫描 FPGA 或 ACAP 并刷新“ Hardware ”窗口。 注释 &#xff1a…

集装箱5G智能制造工厂数字孪生可视化平台,推进企业数字化转型

集装箱5G智能制造工厂数字孪生可视化平台&#xff0c;推进企业数字化转型。在当下数字化转型的热潮中&#xff0c;集装箱5G智能制造工厂数字孪生可视化平台成为了推动企业转型升级的重要工具。这一平台将先进的5G技术与智能制造相结合&#xff0c;通过数字孪生技术实现生产过程…

Doodle Jump — 使用FlutterFlame开发游戏真不错!

前言 最近网上冲浪的时候&#xff0c;我偶然发现了一个国外的游戏网站&#xff0c;里面聚集了各种有趣的小游戏&#xff0c;类似于国内的4399。在浏览时&#xff0c;我遇到了一款经典的小游戏&#xff1a;Doodle Jump。上一次玩还是在上小学的时候&#xff0c;那时候父母在厨房…

【电子通识】普通电阻、敏感电阻、可调电阻的种类和特点

电阻的作用 在【分立元件】理解电阻 中我们知道电阻是在电路中对电流产生阻碍作用的元件。电阻是电子产品中最基本、最常用的电子元件之一。 有各产品的电路板中基本都有电阻器&#xff0c;通常起限流、滤波或分压等作用。实际上&#xff0c;电阻器的种类很多&#xff0c;根据其…

基于SpringBoot+vue网上点餐系统包含万字文档

基于SpringBoot的网上点餐系统包含万字文档 项目视频演示: springboot027网上点餐系统包含万字文档 开发系统:Windows 架构模式:MVC/前后端分离 JDK版本: Java JDK1.8 开发工具:IDEA 数据库版本: mysql8.0 数据库可视化工具: navicat 服务器: SpringBoot自带 apache tomcat 主要…

智慧工地管理平台源码:提供专业落地的解决方案

目录 智慧工地平台功能简介 一、劳务实名制系统 二、智能塔吊可视系统 三、视频监控&#xff08;含安全行为识别&#xff09; 四、环境监测&#xff08;联动自动喷淋&#xff09; 五、起重机械管控&#xff08;含吊钩可视化&#xff09; 六、升降电梯智能管控 七、高支…

每天五分钟深度学习:逻辑回归算法的损失函数和代价函数是什么?

本文重点 前面已经学习了逻辑回归的假设函数,训练出模型的关键就是学习出参数w和b,要想学习出这两个参数,此时需要最小化逻辑回归的代价函数才可以训练出w和b。那么本节课我们将学习逻辑回归算法的代价函数是什么? 为什么不能平方差损失函数 线性回归的代价函数我们使用…

KVM 高级功能部署

目录 一、案例分析 1.1、案例概述 1.2、案例前置知识点 1&#xff09;KVM 虚拟机迁移 2&#xff09;KSM 内核同页合并 1.3、案例环境 1&#xff09;本案例环境 2&#xff09;案例需求 3&#xff09;案例实现思路 二、案例实施 2.1、静态迁移 1&#xff09;在…