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

news2024/11/21 1:47:15

文章目录

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

前言

一、题目

请添加图片描述

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

二、模块初始化

1.LCD这里不用配置,直接使用提供的资源包就行
2.双ADC:开启双ADCsingle-ended
3.LED:开启PC8-15,PD2输出模式就行了。
4.定时器:TIM3(按键消抖定时器):PSC:80-1,ARR:10000-1,TIM4(串口发送计时器):PSC:80-1,ARR:4999,TIM6(LED计时定时器):PSC:80-1,ARR:999,TIM17(输入捕获定时器):PSC:80,ARR:65535
5.i2c:设置PB6,PB7为GPIO_Output模式即可
6.SEG:打开PA1,PA2,PA3GPIO_Output模式
7.打开串口串行输出

三、代码实现

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

interrupt.h:

#ifndef __INTERRUPT_H__
#define __INTERRUPT_H__

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

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

#endif

interrupt.c:

#include "interrupt.h"
#include "ds18b20.h"
#include "stdio.h"
#include "led.h"
/* 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;
double uwDuty_T17CH1 = 0;

extern double Temperature;
extern unsigned char readokFlag;

extern unsigned char ICfirstflag;
unsigned char should_printf;
extern unsigned char printfok;
extern unsigned char LD8FlashFlag;
extern unsigned char LD8FlashTick;
unsigned char LD8Type;
extern unsigned char LED;

void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim)
{
	if(htim->Instance == TIM17)
	{
		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 */      
			}
			else if(uhCaptureIndex_T17CH1 == 2)
			{
				uwIC1Value2_T17CH1 = HAL_TIM_ReadCapturedValue(htim, TIM_CHANNEL_1);
				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;
				}
				uwFrequency_T17CH1 = 1000000 / (uwLowCapture_T17CH1 + uwHighCapture_T17CH1);
				uwDuty_T17CH1 = uwHighCapture_T17CH1 * 100.0 / (uwLowCapture_T17CH1 + uwHighCapture_T17CH1);
				uhCaptureIndex_T17CH1 = 0;
				readokFlag = 0;
				ICfirstflag = 1;
				HAL_TIM_IC_Stop_IT(htim, TIM_CHANNEL_1);
			}
		}
	}
}

char RxBuffer[30];
unsigned char BufIndex= 0;
unsigned char Rxdat;

void HAL_UART_RxCpltCallback(UART_HandleTypeDef * huart)
{
	if(huart->Instance == USART1)
	{
		RxBuffer[BufIndex++] = Rxdat;
		HAL_UART_Receive_IT(huart, &Rxdat, 1);
	}
}

struct keys key[4] = {0, 0, 0, 0, 0};
unsigned char SegTick = 0;
extern unsigned char SegDispflag;

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].key_judge)
			{
				case 0:
				{
					if(key[i].key_sta == 0)
					{
						key[i].key_judge = 1;
						key[i].key_time = 0;
					}
					break;
				}
				case 1:
				{
					if(key[i].key_sta == 0)
					{
						key[i].key_judge = 2;
					}
					else
					{
						key[i].key_judge = 0;
					}
					break;
				}
				case 2:
				{
					if(key[i].key_sta == 1)
					{
						key[i].key_judge = 0;
						if(key[i].key_time < 80)
						{
							key[i].single_flag = 1;
						}
					}
					else
					{
						key[i].key_time++;
						if(key[i].key_time >= 80)
						{
							key[i].long_flag = 1;
						}
					}
					break;
				}
			}
		}
		SegTick++;
		if(SegTick == 200)
		{
			SegTick = 0;
			SegDispflag = !SegDispflag;
		}
	}
	if(htim->Instance == TIM4)
	{
		should_printf = !should_printf;
		if(should_printf == 1)
			printfok = 0;
	}
	if(htim->Instance == TIM6)
	{
		LD8FlashTick++;

		if(LD8FlashTick == 200)
		{
			LD8FlashTick = 0;
			LD8Type = !LD8Type;
			LED = LED & 0x7f | (LD8Type << 7);
		}
	}
}

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) 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 */

/* 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 MAIN 0
#define PARA 1
#define AO1 0
#define AO2 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) 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 "adc.h"
#include "tim.h"
#include "usart.h"
#include "gpio.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "lcd.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "ds18b20.h"
#include "seg.h"
#include "dadc.h"
#include "interrupt.h"
#include "i2c.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 */
char text[30];
float Temperature;
unsigned int SegNum;
double volt_AO1;
double volt_AO2;
extern uint32_t uwFrequency_T17CH1;
extern double uwDuty_T17CH1;
extern char RxBuffer[30];
extern unsigned char BufIndex;
extern unsigned char Rxdat;
unsigned char readokFlag;
extern struct keys key[4];
unsigned char eeprom_readData;
unsigned char eeprom_writeData;
unsigned char DisplayMode;
uint16_t N;
unsigned char T = 30;
unsigned char X;
unsigned char Ttemp = 30;
unsigned char Xtemp;
unsigned char SettingIndex;
unsigned char keywait;
unsigned char SegDispflag;
unsigned char reportFlag;
unsigned char ICfirstflag;
extern unsigned char should_printf;
unsigned char printfok;
unsigned char LED;
unsigned char LD8FlashFlag;
unsigned char LD8FlashTick;
extern unsigned char LD8Type;
/* USER CODE END PV */

/* Private function prototypes -----------------------------------------------*/
void SystemClock_Config(void);
/* USER CODE BEGIN PFP */
void Rx_Proc(void);
void DisposeKey(void);
void LCD_Disp(void);
void Seg_Echo(void);
/* 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_TIM17_Init();
  MX_USART1_UART_Init();
  MX_TIM16_Init();
  MX_TIM3_Init();
  MX_TIM4_Init();
  MX_TIM6_Init();
  /* USER CODE BEGIN 2 */
	while((unsigned int)(ds18b20_readT()) == 85)
	{
		if(uwTick > 200) break;
	}
	HAL_TIM_IC_Start_IT(&htim17, TIM_CHANNEL_1);
	getDualADC(&hadc2);
	HAL_Delay(2);
	getDualADC(&hadc2);
	volt_AO1 = adc2_in17_AO1 * 3.3 / 4096;
	volt_AO2 = adc2_in13_AO2 * 3.3 / 4096;
	LED_Disp(0x00);
	if(ICfirstflag)
	{
		if(X == AO1)
		{
			if(volt_AO1 > uwDuty_T17CH1 / 100.0 * 3.3)
			{
				reportFlag = 1;
			}
			else
			{
				reportFlag = 0;
//				printf("duty:%.2f\n", volt_AO1);
			}
		}
		if(X == AO2)
		{
			if(volt_AO2 > uwDuty_T17CH1 / 100.0 * 3.3)
				reportFlag = 1;
			else reportFlag = 0;
		}
	}
	N = eeprom_read(0) | eeprom_read(1) << 8;
	LCD_Init();
	LCD_Clear(Black);
	LCD_SetBackColor(Black);
	LCD_SetTextColor(White);
	HAL_UART_Receive_IT(&huart1, &Rxdat, 1);
	HAL_TIM_Base_Start_IT(&htim3);
//	while((unsigned int)uwDuty_T17CH1 == 0)
//	{
		if(uwTick > 999) break;
//	}
  /* USER CODE END 2 */

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

    /* USER CODE BEGIN 3 */
		getDualADC(&hadc2);
		volt_AO1 = adc2_in17_AO1 * 3.3 / 4096;
		volt_AO2 = adc2_in13_AO2 * 3.3 / 4096;
		if(readokFlag == 0)
		{
			Temperature = ds18b20_readT();
			HAL_TIM_IC_Start_IT(&htim17, TIM_CHANNEL_1);
			readokFlag = 1;
		}
		if(Temperature > (double)T)
		{
			LD8FlashFlag = 1;
			HAL_TIM_Base_Start_IT(&htim6);
		}
		else
		{
			HAL_TIM_Base_Stop_IT(&htim6);
			__HAL_TIM_SetCounter(&htim6, 0);
			LD8FlashTick = 0;
			LD8FlashFlag = 0;
			LD8Type = 0;
			LED = LED & 0x7f;
		}
		if(BufIndex != 0)
		{
			unsigned char Indextemp = BufIndex;
			HAL_Delay(1);
			if(BufIndex == Indextemp)
				Rx_Proc();
		}
		if(X == AO1)
		{
			if(volt_AO1 > uwDuty_T17CH1 / 100.0 * 3.3)
			{
				reportFlag = 1;
			}
			else
			{
				reportFlag = 0;
//				printf("duty:%.2f\n", volt_AO1);
			}
		}
		if(X == AO2)
		{
			if(volt_AO2 > uwDuty_T17CH1 / 100.0 * 3.3)
				reportFlag = 1;
			else reportFlag = 0;
		}
		if(reportFlag)
		{
			LED = LED & 0xfe | 0x01;
			HAL_TIM_Base_Start_IT(&htim4);
		}
		else
		{
			LED = LED & 0xfe;
			HAL_TIM_Base_Stop_IT(&htim4);
			__HAL_TIM_SetCounter(&htim4, 0);
			should_printf = 0;
		}
		DisposeKey();
		LCD_Disp();
		Seg_Echo();
		LED_Disp(LED);
		if(should_printf)
		{
			if(printfok == 0)
			{
				printf("$%.2lf\r\n", Temperature);
				printfok = 1;
			}
		}
//		HAL_Delay(500);
  }
  /* 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 */
int fputc(int ch, FILE * f)
{
	HAL_UART_Transmit(&huart1, (unsigned char *)&ch, 1, HAL_MAX_DELAY);
	return ch;
}

void Rx_Proc(void)
{
	if(strncmp(RxBuffer, "ST", 2) == 0)
	{
		printf("$%.2lf\r\n", Temperature);
	}
	if(strncmp(RxBuffer, "PARA", 4) == 0)
	{
		printf("#%d,AO%d\r\n", T, X+1);
	}
	memset(RxBuffer, 0, 30);
	BufIndex = 0;
}

void DisposeKey(void)
{
	if(key[0].single_flag)
	{
		LCD_Clear(Black);
		if(DisplayMode == MAIN)
		{
			DisplayMode = PARA;
		}
		else if(DisplayMode == PARA)
		{
			DisplayMode = MAIN;
			if(X != Xtemp || (unsigned char)Ttemp != (unsigned char)T)
			{
				if(N + 1 == 65536)
					N = 65535;
				else
					N += 1;
				Xtemp = X;
				Ttemp = T;
				eeprom_write(0, N & 0xff);
				HAL_Delay(10);
				eeprom_write(1, (N >> 8) & 0xff);
			}
		}
		key[0].single_flag = 0;
	}
	if(key[1].single_flag)
	{
		if(DisplayMode == PARA)
		{
			SettingIndex = !SettingIndex;
		}
		key[1].single_flag = 0;
	}
	if(key[2].single_flag)
	{
		if(DisplayMode == PARA)
		{
			if(SettingIndex == 0)
			{
				if((unsigned char)(T+1) <= 40)
					T += 1;
			}
			if(SettingIndex == 1)
			{
				X = !X;
			}
		}
		key[2].single_flag = 0;
	}
	if(key[2].long_flag)
	{
		if(DisplayMode == PARA)
		{
			if(SettingIndex == 0)
			{
				keywait++;
				if(keywait == 4)
				{
					keywait = 0;
					if((unsigned char)(T+1) <= 40)
						T += 1;
				}
			}
		}
		key[2].long_flag = 0;
	}
	if(key[3].single_flag)
	{
		if(DisplayMode == PARA)
		{
			if(SettingIndex == 0)
			{
				if((unsigned char)(T-1) >= 20)
					T -= 1;
			}
			if(SettingIndex == 1)
			{
				X = !X;
			}
		}
		key[3].single_flag = 0;
	}
	if(key[3].long_flag)
	{
		if(DisplayMode == PARA)
		{
			if(SettingIndex == 0)
			{
				keywait++;
				if(keywait == 4)
				{
					keywait = 0;
					if((unsigned char)(T-1) >= 20)
						T -= 1;
				}
			}
		}
		key[3].long_flag = 0;
	}
}

void LCD_Disp(void)
{
	if(DisplayMode == MAIN)
	{
		LCD_DisplayStringLine(Line0, "        Main");
		sprintf(text, "  A01:%.2fV", volt_AO1);
		LCD_DisplayStringLine(Line1, text);
		sprintf(text, "  A02:%.2fV", volt_AO2);
		LCD_DisplayStringLine(Line3, text);
		sprintf(text, "  PWM2:%d%% ", (unsigned char)uwDuty_T17CH1);
		LCD_DisplayStringLine(Line5, text);
		sprintf(text, "  Temp:%.2fC ", Temperature);
		LCD_DisplayStringLine(Line7, text);
		sprintf(text, "  N:%d", N);
		LCD_DisplayStringLine(Line9, text);
	}
	if(DisplayMode == PARA)
	{
		LCD_DisplayStringLine(Line0, "        Para");
		sprintf(text, "T:%d                ", (unsigned char)T);
		if(SettingIndex == 0) LCD_SetBackColor(Yellow);
		LCD_DisplayStringLine(Line2, text);
		LCD_SetBackColor(Black);
		sprintf(text, "X:A0%d               ", X+1);
		if(SettingIndex == 1) LCD_SetBackColor(Yellow);
		LCD_DisplayStringLine(Line4, text);
		LCD_SetBackColor(Black);
	}
}

void Seg_Echo(void)
{
	if(SegDispflag == 0)
	{
		SEG_Disp(12, T / 10, T % 10);
	}
	else
	{
		SEG_Disp(10, 0, X + 1);
	}
}
/* 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/542393.html

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

相关文章

chatgpt赋能Python-python3_6安装keras

在Ubuntu 16.04上安装Keras Keras是一个非常流行的Python深度学习库&#xff0c;它可以让你高效地构建和训练深度神经网络。在本指南中&#xff0c;我们将介绍如何在Ubuntu 16.04上安装Keras&#xff0c;并建立一个简单的基于CNN的图像分类器。 准备工作 在安装Keras之前&am…

MySQL 基础篇 1.1 执行一条SQL语句会发生什么

1. MySQL架构一共分为两层 server 和 存储引擎层&#xff08;一般为Innodb引擎&#xff09; 主要执行流程都在server层&#xff1a;连接器&#xff0c;查询缓存&#xff0c;解析SQL&#xff08;解析器&#xff09;&#xff0c;执行SQL&#xff08;预处理器&#xff0c;优化器&a…

2023年ES的使用总结

1.Elasticsearch 非常强大的开源搜索引擎&#xff0c;可以帮助我们从海量数据中快速找到需要的内容 什么是elasticsearch 一个开源的分布式搜索引擎&#xff0c;可以用来实现搜索、日志统计、分析、系统监控 什么是elastic stack 是以elasticsearch为核心的技术栈&#xf…

运算符重载函数作为类的成员函数——有理数的约分

目录 一、题目 二、代码 三、算法分析 &#xff08;一&#xff09;数学表达式 &#xff08;二&#xff09; 代码实现 一&#xff09;运算符重载函数 二&#xff09;优化函数&#xff08;实现有理数约分&#xff09; 一、题目 通过运算符重载为类的成员函数来实现两个有…

【云计算与虚拟化】第二章 实验一 VMware Workstation的使用

实验一 vmware workstation的使用 安装Windows Server 2012 R2虚拟机&#xff0c;并激活&#xff08;计算机命名为&#xff1a;学号姓名拼音的首字母&#xff09; 2.在Windows Server 2012 R2的虚拟机中安装VMTools 3.关机创建快照&#xff08;快照命名为&#xff1a;学号姓名…

OMG Data Distribution Service(DDS)规范解读-Part4

目录 2.4 Listeners, Conditions, and Wait-sets2.4.1 Communication Status2.4.2 Changes in Status2.4.2.1 Plain communication statuses2.4.2.2 Read Communication Statuses 2.2.4.3 Access through Listeners2.2.4.3.1 Listener Access to Plain Communication Status2.2…

I2C总线

基于linux-3.14.16 一、注册I2C总线 以上代码即完成了i2c总线的注册&#xff0c;并且添加了一个i2c驱动dummy_driver 二、注册适配器 1、平台总线匹配 设备树有i2c1设备 平台总线匹配后执行probe 2、执行probe 获取中断号 获取地址资源并映射 填充i2c_adapter&#…

chatgpt赋能Python-python3_7如何安装matplotlib

Python3.7如何安装Matplotlib Matplotlib是一个Python的绘图库&#xff0c;可以帮助用户制作2D和3D图表和图形。它利用了NumPy、SciPy和其他Python包&#xff0c;具有出色的兼容性和可视化效果&#xff0c;广泛应用于数据分析、科学计算和工程领域。在本篇文章中&#xff0c;我…

chatgpt赋能Python-python2转3

Python2转3的最终结论 Python是一种流行的编程语言&#xff0c;但随着Python 2的维护结束&#xff0c;许多开发者正在考虑将他们的代码从Python 2升级到Python 3。这篇文章将介绍如何在搜索引擎优化&#xff08;SEO&#xff09;方面实现Python 2转3&#xff0c;并讨论为什么这…

页面样式问题收集及解决方案导航

1、el-table表头文字换行https://blog.csdn.net/qq_44747461/article/details/105976042 2、element-ui动态更改el-table某个单元格字体颜色&#xff1a;https://blog.csdn.net/agua001/article/details/107960393 Element UI 表格 el-table-column根据不同值显示不同颜色&…

ChatGPT工作提效之在程序开发中的巧劲和指令(创建MySQL语句、PHP语句、Javascript用法、python的交互)

ChatGPT工作提效之程序开发中的巧劲 前言一、创建MySQL数据表1.创建指令2.交互评价 二、PHP交互语句1.创建指令2.交互评价 三、javascript的交互用法1.创建指令2.交互评价 四、python的交互1.创建指令2.交互评价 总结 前言 ChatGPT是一个基于GPT模型训练的聊天机器人&#xff…

【Maven从入门到入土】

文章目录 1.Maven1.1 初识Maven依赖管理&#xff1a;统一项目结构 :项目构建 : 1.2 Maven概述1.2.1 Maven模型1.2.2 Maven仓库1.2.3 Maven安装 1.3 IDEA集成Maven1.3.1 配置Maven环境1.3.1.1 当前工程设置1.3.1.2 全局设置 1.3.2 Maven项目1.3.2.1 创建Maven项目1.3.2.2 POM配置…

代码随想录训练营Day37| 738.单调递增的数字 968.监控二叉树 总结

目录 学习目标 学习内容 738.单调递增的数字 968.监控二叉树 总结 学习目标 738.单调递增的数字 968.监控二叉树 总结 学习内容 738.单调递增的数字 738. 单调递增的数字 - 力扣&#xff08;LeetCode&#xff09;https://leetcode.cn/problems/monotone-increasing-di…

【云计算与虚拟化】第二章 实验二 Vmware Workstation 15的使用

实验二 Vmware Workstation 15的使用 在上一实验的基础上&#xff0c;将两台虚拟机调节到在桥接模式下&#xff0c;配置相应的网络参数&#xff0c;实现虚拟机1和2能相互通信&#xff0c;虚拟机1和2能够ping通外网&#xff0c;虚拟机1和2能ping通物理机。 &#xff08;截取…

GE SR469-P5-HI-A20 带有5A相CT次级线圈的标准装置

SR469-P5-HI-A20提供四路4-20 mA模拟输出。该装置已通过CE认证。这是一个带有5A相CT次级线圈的标准装置。该装置的控制电源额定为90-300伏直流电&#xff0c;70-265伏交流电&#xff0c;48-62赫兹。 制造商美国通用电气公司&#xff0c;通用工业系统电压供应交流电:48-62赫兹时…

【云计算与虚拟化】第四章 实验一 在Windows 系统部署vCenter Server

实验一 在Windows 系统部署vCenter Server 1.部署两台ESXi6.0 虚拟主机&#xff0c;其余参数可以参考实验IP拓扑 2.在Windows Server 2012 R2中部署Storge服务器,该服务器名字为&#xff1a;姓名的拼音的首字母1&#xff0c;且要实现以下三个功能&#xff1a; (1)AD域控制…

【5.15】一、软件测试基础—软件概述

目录 1.1 软件概述 1.1.1 软件生命周期 1.1.2 软件开发模型 1.1.3 软件质量概述 1.1 软件概述 软件是相对于硬件而言的&#xff0c;它是一系列按照特定顺序组织的计算机数据和指令的集合。 软件的生命周期&#xff1a;软件从“出生” 到 “消亡” 的过程。 1.1.1 软件生…

超详细!Xmind的学习

哈喽&#xff0c;大家好。最近有小伙伴问使用xmind思维导图怎么快速上手&#xff0c;今天便给各位小伙伴出了这一期快速上手教程。思维导图的上手其实都是很简单的&#xff0c;只要知道基本功能的使用&#xff0c;基本上半天就能学会&#xff0c;一天就能熟练。 一、学习准备 …

【SpringBoot整合JWT】

目录 一、什么是JWT 二、JWT能做什么 三、为什么是JWT 1、基于传统的Session认证 2、基于JWT认证 四、JWT的结构是什么 五、JWT的第一个程序 六、封装JWT工具类 七、整合SpringBoot使用 一、什么是JWT JSON Web Token (JWT) is an open standard ([RFC 7519](http…

chatgpt赋能Python-python2转换为python3

Python 2到Python 3的转换和优化 在过去的几年中&#xff0c;Python 3已经成为了最流行的Python版本。因此&#xff0c;Python 2用户开始转向Python 3&#xff0c;以提高性能、安全性和可靠性。本文将讨论Python 2到Python 3的转换以及一些实用的优化技巧。 为什么要转向Pyth…