【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 frequencymeasures */Error_Handler();}uhCaptureIndex_T17CH1 = 2;uwIC1Value1_T17CH1 = uwIC1Value2_T17CH1;/* Frequency computation: for this example TIMx (TIM1) is clocked byAPB2Clk */      
//      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 frequencymeasures */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.mzph.cn/news/809568.shtml

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

相关文章

Unity单个物体绑定多个相机在轨道上移动,录制不同角度视频

环境搭建 下载Cinemachine插件安装 打开包管理器 下载cinemachine插件 创建轨道 使用dolly track 创建轨道 右侧可以删减关键点&#xff0c;注意调整y坐标 创建cart 把前面的轨道拖到path中&#xff0c;注意这里的speed要设定不为0才会动 设置VItual Camera 根据需…

使用Code开发Django_模版和CSS

转到定义 和 查看定义 在使用Django或任何其他库的过程中,我们可能需要检查这些库中的代码。VS Code提供了两个方便的命令,可以直接导航到任何代码中的类和其他对象的定义: 转到定义 在Python开发环境中,我们可以轻松地对函数、类或者其他导入模块中的成员使用“Go to Def…

【C 数据结构】双向链表

文章目录 【 1. 基本原理 】【 2. 双向链表的 创建 】实例 - 输出双向链表 【 3. 双向链表 添加节点 】【 4. 双向链表 删除节点 】【 5. 双向链表查找节点 】【 7. 双向链表更改节点 】【 8. 实例 - 双向链表的 增删查改 】 【 1. 基本原理 】 表中各节点中都只包含一个指针&…

【算法练习】30:快速排序学习笔记

一、快速排序的算法思想 原理&#xff1a;快速排序基于分治策略。它的基本思想是选择一个元素作为“基准”&#xff0c;将待排序序列划分为两个子序列&#xff0c;使得左边的子序列中的所有元素都小于基准&#xff0c;右边的子序列中的所有元素都大于基准。这个划分操作被称为分…

Elasticsearch部署安装

环境准备 Anolis OS 8 Firewall关闭状态&#xff0c;端口自行处理 Elasticsearch&#xff1a;7.16.1&#xff08;该版本需要jdk11&#xff09; JDK&#xff1a;11.0.19 JDK # 解压 tar -zxvf jdk-11.0.19_linux-x64_bin.tar.gz# 编辑/etc/profile vim /etc/profile# 加入如下…

Halcon颜色抽取-多产品颜色(MLP)

前言 //颜色抽取&#xff0c;单产品多区域 https://blog.csdn.net/m0_51559565/article/details/135216905由于在颜色抽取上面&#xff0c;我已经发了一篇博客了&#xff0c;是单产品多区域的情况。所以对于细分原理上就不过多的描述了。 本文主要是针对多产品多颜色的情况进行…

模型训练-保存训练数据

1.目的 找到一个可运行的代码&#xff0c;可以每个epoch打印训练数据&#xff0c;但是不会保存。因为在改进模型需要这些训练数据进行对比&#xff0c;所以需要将每个epoch的训练数据保存下来&#xff0c;写到一个文件中。 2.解决方案 直接问ChatGPT&#xff0c;提示词如下&…

SpringMVC原理及工作流程

组件 SpringMVC的原理主要基于它的各个组件之间的相互协作交互&#xff0c;从而实现了Web请求的接收&#xff0c;处理和响应。 它的组件有如下几个&#xff1a; DispatcherServlet前端控制器 HandlerMapping处理器映射器 Controller处理器 ModelAndView ViewResolver视图…

练习题(2024/4/11)

1每日温度 给定一个整数数组 temperatures &#xff0c;表示每天的温度&#xff0c;返回一个数组 answer &#xff0c;其中 answer[i] 是指对于第 i 天&#xff0c;下一个更高温度出现在几天后。如果气温在这之后都不会升高&#xff0c;请在该位置用 0 来代替。 示例 1: 输入…

Leetcode刷题之消失的数字(C语言版)

Leetcode刷题之消失的数字&#xff08;C语言版&#xff09; 一、题目描述二、题目解析 一、题目描述 数组nums包含从0到n的所有整数&#xff0c;但其中缺了一个。请编写代码找出那个缺失的整数。你有办法在O(n)时间内完成吗&#xff1f; 注意&#xff1a;本题相对书上原题稍作…

Java中实现监听UDP协议的指定端口并收到数据按照十六进制输出

场景 对接协议中需要监听UDP协议的指定端口并监听数据&#xff0c;且数据格式为十六进制。 如果是在linux服务上&#xff0c;可以快速通过C或者python脚本等方式实现。 这里使用Java代码实现&#xff0c;可便于后续做其他存储数据等的扩展&#xff0c;且只需要在服务器上安装…

华为OD七日集训第6期 - 按算法分类,由易到难,循序渐进,玩转OD

目录 一、适合人群二、本期训练时间三、如何参加四、七日集训第 6 期五、精心挑选21道高频经典题目&#xff0c;作为入门。第1天、逻辑分析第2天、双指针第3天、滑动窗口第4天、二叉树第5天、矩阵第6天、分治递归第7天、深度优先搜索 大家好&#xff0c;我是哪吒。 最近一直在…

《安静的力量》探寻自我的心灵之旅,找到内心的宁静和真正的幸福 - 三余书屋 3ysw.net

安静的力量&#xff1a;通往止境的冒险 大家好&#xff0c;今天我们要解读的书籍是《安静的力量》。让我们先设想一个画面&#xff1a;在纽约曼哈顿&#xff0c;紧邻繁华的时代广场&#xff0c;一位29岁的青年在他的公寓里工作。这里毗邻纽约最富有人群的聚居区&#xff0c;而…

Windows Edge 兼容性问题修复:提升用户体验的关键步骤

&#x1f31f; 前言 欢迎来到我的技术小宇宙&#xff01;&#x1f30c; 这里不仅是我记录技术点滴的后花园&#xff0c;也是我分享学习心得和项目经验的乐园。&#x1f4da; 无论你是技术小白还是资深大牛&#xff0c;这里总有一些内容能触动你的好奇心。&#x1f50d; &#x…

Django框架的基础知识

Django&#xff08;英文发音&#xff1a;dʒŋgəʊ&#xff09;是一个开放源代码的Web应用框架&#xff0c;使用高性能的Python语言编写而成。Django框架的诞生&#xff0c;最初是用来开发和管理Lawrence Publishing Group&#xff08;劳伦斯出版集团&#xff09;旗下的新闻网…

【vscode】在本地加载远端环境并开发

【vscode】在本地利用远程服务器显卡跑代码 写在最前面vscode&#xff1a;远程到本地1、安装ssh插件2、添加服务器连接配置3、连接服务器4. SSH配置5. 在ssh中安装python解释器 vscode基本操作 &#x1f308;你好呀&#xff01;我是 是Yu欸 &#x1f30c; 2024每日百字篆刻时光…

BLIP 算法阅读记录---一个许多多模态大语言模型的基本组件

论文地址&#xff1a;&#x1f608; 目录 一、环境配置以及数据集准备 数据集准备 数据集格式展示 环境配置&#xff0c;按照官网所述即可 二、一些调整 vit_base的预训练模型 远程debug的设置 Tokenizer初始化失败 读入网络图片的调整 三、训练过程 Image Encoder …

FebHost:英国.UK域名注册使用中存在哪些侵权行为?

截至2023年6月&#xff0c;英国.uk域名作为全球第五大热门顶级域名&#xff0c;注册数量超过1100万&#xff0c;成为全球最知名和广泛使用的域名之一。英国域名家族包括四个独特的域名后缀——.uk、.co.uk、.org.uk 和 .me.uk——每个都有其独特的特点&#xff0c;并根据数字领…

Mac下用adb命令安装apk到android设备笔记

查询了些资料记录备用。以下是在Mac上使用命令行安装APK文件的步骤&#xff1a; 1. 下载并安装ADB&#xff1a; 如果您的Mac上没有安装ADB&#xff0c;请从官方的Android开发者网站下载Android SDK Platform Tools&#xff1a;Android SDK Platform Tools。将下载的ZIP文件解…

三次 Bspline(B样条曲线) NURBS曲线的绘制 matlab

先来了解几个概念&#xff1a; 1.1 节点向量&#xff1a; B-Spline需要定义曲线的节点向量U&#xff0c;它可以对应到Bezier曲线的参数u。 其元素个数 (m1) 和曲线阶数 k 、控制点个数n满足&#xff1a;m1k1n1 如果U的每段的距离是相等&#xff0c;那么这个B-Spline就被称为均…