当前位置: 首页 > news >正文

【STM32 开发】| INA219采集电压、电流值

目录

  • 前言
  • 1 原理图
  • 2 IIC地址说明
  • 3 寄存器地址说明
  • 4 开始工作前配置
  • 5 程序代码
    • 1)驱动程序
    • 2)头文件
    • 3) 测试代码

前言

INA219 是一款具备 I2C 或 SMBUS 兼容接口的分流器和功率监测计。该器件监测分流器电压降和总线电源电压,转换次数和滤波选项可通过编程设定。可编程校准值与内部乘法器相结合,支持直接读取电流值(单位:安培)。通过附加乘法寄存器可计算功率(单位:瓦)。I2C 或 SMBUS 兼容接口 具有 16 个可编程地址。

INA219 可在 0V 至 26V 范围内感测总线中的分压。该器件由 3V 至 5.5V 单电源供电,电源的最大流耗为1mA。INA219 的工作温度范围为 -40°C 至 125°C。

1 原理图

在这里插入图片描述

2 IIC地址说明

在这里插入图片描述
此测试时A0、A1都下拉接地,所以INA219的IIC通信地址为1000000B

3 寄存器地址说明

在这里插入图片描述

  • 0x00 配置寄存器,用来配置工作模式、采集范围以及其他参数
  • 0x01 分流电阻两端的电压
  • 0x02 总线电压(IN-到GND的电压差)
  • 0x03 功率
  • 0x04 经过分流电阻两端的电流
  • 0x05 校准寄存器,用于对测量结果进行校准

4 开始工作前配置

  • 0x00 寄存器Bit 13:设置检测最大检测电压 0 = 16V,1 = 32V (此处项目需要测3V到5V的电压,故设置Bit 13 为 0
  • 0x00 寄存器Bit 11-12:设置总线分流电阻最大的电压(此处项目需要测0A到5A的电流,故设置Bit 11-12 为 01,即量程±80mV,可测电流±8A
  • 0x00 寄存器Bit 0-2:设置工作模式(默认)
  • 0x05 寄存器:设置基准值(根据需要测的电压、电流范围再套入公式得出结果

由以下公式可得出0x05的配置值。
C a l = t r u n c ( 0.04096 C u r r e n t L S B × R s h u n t ) Cal = trunc\left ( \frac{0.04096}{CurrentLSB\times Rshunt} \right ) Cal=trunc(CurrentLSB×Rshunt0.04096)
C u r r e n t L S B = M a x i m u m E x p e c t e d C u r r e n t 2 15 CurrentLSB = \frac{Maximum Expected Current}{2^{15}} CurrentLSB=215MaximumExpectedCurrent

数据手册说明文档
在这里插入图片描述

5 程序代码

1)驱动程序

#include "main.h"
#include "ina219aidcnr_helper.h"uint16_t ina219_calibrationValue;
uint16_t ina219_currentDivider_mA;
float ina219_powerMultiplier_mW;/*** @brief  The IIC reads 16bit data from the specified register address.* @param  ina219 Slave configuration structure of the IIC.* @param  registerAddress Internal memory address.* @return 16 bit register data.*/
uint16_t INA219_ReadDataForRegister_16Bits(INA219_t *ina219, uint8_t registerAddress)
{uint8_t Value[2];HAL_I2C_Mem_Read(ina219->ina219_i2c, (INA219_ADDRESS<<1), registerAddress, 1, Value, 2, 1000);return ((Value[0] << 8) | Value[1]);
}/*** @brief  Writes 16 bits of data to the register.* @param  ina219 Slave configuration structure of the IIC.* @param  registerAddress Internal memory address.* @param  Value 16 bits of data to be written.*/
void INA219_WriteDataToRegister_16Bits(INA219_t *ina219, uint8_t registerAddress, uint16_t Value)
{uint8_t regAddr[2];/* High Byte */regAddr[0] = (Value >> 8) & 0xff;/* Low Byte */regAddr[1] = (Value >> 0) & 0xff;HAL_I2C_Mem_Write(ina219->ina219_i2c, (INA219_ADDRESS<<1), registerAddress, 1, (uint8_t*)regAddr, 2, 1000);
}/*** @brief  Read bus voltage.* @param  ina219 Slave configuration structure of the IIC.* @return Read voltage value, unit mV.*/
uint16_t INA219_ReadBusVoltage(INA219_t *ina219)
{uint16_t result = INA219_ReadDataForRegister_16Bits(ina219, INA219_REG_BUS_VOLTAGE);/* return mV */return ((result >> 3  ) * 4);
}/*** @brief  Read current register value.* @param  ina219 Slave configuration structure of the IIC.* @return Current register value.*/
uint16_t INA219_ReadCurrentRaw(INA219_t *ina219)
{uint16_t result = INA219_ReadDataForRegister_16Bits(ina219, INA219_REG_CURRENT);return (result);
}/*** @brief  Read current register value, unit mA.* @param  ina219 Slave configuration structure of the IIC.* @return Current value.*/
uint16_t INA219_ReadCurrent_mA(INA219_t *ina219)
{uint16_t result = INA219_ReadCurrentRaw(ina219);return (result / ina219_currentDivider_mA);
}/*** @brief  Read current register value, unit mV.* @param  ina219 Slave configuration structure of the IIC.* @return Shunt Voltage value.*/
uint16_t INA219_ReadShuntVoltage_mV(INA219_t *ina219)
{uint16_t result = INA219_ReadDataForRegister_16Bits(ina219, INA219_REG_SHUNT_VOLTAGE);/* When multiple sign bits are present, they will all be the same value.* Negative numbers are represented in 2's complement format.* Generate the 2's complement of a negative number by complementing the absolute value binary number and adding 1.* Extend the sign, denoting a negative number by setting the MSB = 1.* Extend the sign to any additional sign bits to form the 16-bit word. */if(result > MAX_SHUNT_RANGE){result = 65536 - MAX_SHUNT_RANGE;}/* Shunt voltage, unit mV. */return (result / 100);
}/*** @brief  INA219 system reset.* @param  ina219 Slave configuration structure of the IIC.*/
void INA219_Reset(INA219_t *ina219)
{INA219_WriteDataToRegister_16Bits(ina219, INA219_REG_CONFIG, INA219_CONFIG_RESET);HAL_Delay(1);
}/*** @brief Set calibration register.* @param ina219 Slave configuration structure of the IIC.* @param calibrationData Calibrated data.*/
void INA219_SetCalibration(INA219_t *ina219, uint16_t calibrationData)
{INA219_WriteDataToRegister_16Bits(ina219, INA219_REG_CALIBRATION, calibrationData);
}/*** @brief  Gets the value of the configuration register.* @param  ina219 Slave configuration structure of the IIC.* @return Configuration Register value.*/
uint16_t INA219_GetConfigInfo(INA219_t *ina219)
{uint16_t result = INA219_ReadDataForRegister_16Bits(ina219, INA219_REG_CONFIG);return result;
}/*** @brief Set configuration register.* @param ina219 Slave configuration structure of the IIC.* @param configData Configuration data.*/
void INA219_SetConfig(INA219_t *ina219, uint16_t configData)
{INA219_WriteDataToRegister_16Bits(ina219, INA219_REG_CONFIG, configData);
}/*** @brief The measurement results are calibrated. Voltage range is 16V, Current range is 8A.* @param ina219 Slave configuration structure of the IIC.*/
void INA219_SetCalibration_16V_8A(INA219_t *ina219)
{uint16_t configInfo = INA219_CONFIG_VOLTAGE_RANGE_16V |INA219_CONFIG_GAIN_2_80MV | INA219_CONFIG_BADCRES_12BIT |INA219_CONFIG_SADCRES_12BIT_1S_532US |INA219_CONFIG_MODE_SANDBVOLT_CONTINUOUS;// Current_LSB = Maximum Expected Current / 2^15 = (80 / 10) / 2^15 = 0.0002// Cal = 0.04096 / (Current_LSB / R) = 0.04096 / (0.0002A * 0.01R) = 20480 = 0x5000// Calibration Register = 20480ina219_calibrationValue = 20480;// 1mA = Current_LSB * bits = 200uA * 5bit (5 bit/mA)ina219_currentDivider_mA = 5;// 1mW = Power_LSB * bits = 4mW * 0.25bit (0.25f bit/mW)ina219_powerMultiplier_mW = 0.25f;INA219_SetCalibration(ina219, ina219_calibrationValue);INA219_SetConfig(ina219, configInfo);
}/*** @brief  Ina219 driver initialization* @param  ina219 Slave configuration structure of the IIC.* @param  i2c Pointer to a I2C_HandleTypeDef structure that contains*             the configuration information for the specified I2C.* @param  Address  Configuration data.* @return status.*/
uint8_t INA219_Init(INA219_t *ina219, I2C_HandleTypeDef *i2c, uint8_t Address)
{ina219->ina219_i2c = i2c;ina219->Address = Address;ina219_currentDivider_mA = 0;ina219_powerMultiplier_mW = 0;uint8_t ina219_isReady = HAL_I2C_IsDeviceReady(i2c, (Address << 1), 3, 2);if(ina219_isReady == HAL_OK){INA219_Reset(ina219);INA219_SetCalibration_16V_8A(ina219);return 1;}else{return 0;}
}

2)头文件


#ifndef INA219AIDCNR_HELPER_H
#define INA219AIDCNR_HELPER_H#define INA219_ADDRESS 							        (0x40)
#define MAX_SHUNT_RANGE                     			(0x0FA0)/* Register */
#define	INA219_REG_CONFIG						        (0x00)
#define	INA219_REG_SHUNT_VOLTAGE				    	(0x01)
#define	INA219_REG_BUS_VOLTAGE					    	(0x02)
#define	INA219_REG_POWER						        (0x03)
#define	INA219_REG_CURRENT						      	(0x04)
#define	INA219_REG_CALIBRATION					    	(0x05)
//
#define INA219_CONFIG_RESET 					      	(0x8000)
//
#define INA219_CONFIG_VOLTAGE_RANGE_16V					(0x0000)      // 0-16V Range
#define INA219_CONFIG_VOLTAGE_RANGE_32V					(0x2000)      // 0-32V Range#define	INA219_CONFIG_GAIN_1_40MV				    	(0x0000)      // Gain 1, 40mV Range
#define	INA219_CONFIG_GAIN_2_80MV				    	(0x0800)      // Gain 2, 80mV Range
#define	NA219_CONFIG_GAIN_4_160MV				    	(0x1000)      // Gain 4, 160mV Range
#define	INA219_CONFIG_GAIN_8_320MV				  		(0x1800)      // Gain 8, 320mV Range#define	INA219_CONFIG_BADCRES_9BIT				      	(0x0000)  // 9-bit bus res = 0..511
#define	INA219_CONFIG_BADCRES_10BIT				      	(0x0080)  // 10-bit bus res = 0..1023
#define	INA219_CONFIG_BADCRES_11BIT				      	(0x0100)  // 11-bit bus res = 0..2047
#define	INA219_CONFIG_BADCRES_12BIT				      	(0x0180)  // 12-bit bus res = 0..4097
#define	INA219_CONFIG_BADCRES_12BIT_2S_1060US 			(0x0480)  // 2 x 12-bit bus samples averaged together
#define	INA219_CONFIG_BADCRES_12BIT_4S_2130US	  		(0x0500)  // 4 x 12-bit bus samples averaged together
#define	INA219_CONFIG_BADCRES_12BIT_8S_4260US	  		(0x0580)  // 8 x 12-bit bus samples averaged together
#define	INA219_CONFIG_BADCRES_12BIT_16S_8510US			(0x0600)  // 16 x 12-bit bus samples averaged together
#define	INA219_CONFIG_BADCRES_12BIT_32S_17MS	  		(0x0680)  // 32 x 12-bit bus samples averaged together
#define	INA219_CONFIG_BADCRES_12BIT_64S_34MS	  		(0x0700)  // 64 x 12-bit bus samples averaged together
#define	INA219_CONFIG_BADCRES_12BIT_128S_69MS	  		(0x0780)  // 128 x 12-bit bus samples averaged together#define	INA219_CONFIG_SADCRES_9BIT_1S_84US		  		(0x0000)  // 1 x 9-bit shunt sample
#define	INA219_CONFIG_SADCRES_10BIT_1S_148US	  		(0x0008)  // 1 x 10-bit shunt sample
#define	INA219_CONFIG_SADCRES_11BIT_1S_276US	  		(0x0010)  // 1 x 11-bit shunt sample
#define	INA219_CONFIG_SADCRES_12BIT_1S_532US	  		(0x0018)  // 1 x 12-bit shunt sample
#define	INA219_CONFIG_SADCRES_12BIT_2S_1060US	  		(0x0048)  // 2 x 12-bit shunt samples averaged together
#define	INA219_CONFIG_SADCRES_12BIT_4S_2130US	  		(0x0050)  // 4 x 12-bit shunt samples averaged together
#define	INA219_CONFIG_SADCRES_12BIT_8S_4260US	 	 	(0x0058)  // 8 x 12-bit shunt samples averaged together
#define	INA219_CONFIG_SADCRES_12BIT_16S_8510US			(0x0060)  // 16 x 12-bit shunt samples averaged together
#define	INA219_CONFIG_SADCRES_12BIT_32S_17MS	  		(0x0068)  // 32 x 12-bit shunt samples averaged together
#define	INA219_CONFIG_SADCRES_12BIT_64S_34MS	  		(0x0070)  // 64 x 12-bit shunt samples averaged together
#define	INA219_CONFIG_SADCRES_12BIT_128S_69MS	  		(0x0078)  // 128 x 12-bit shunt samples averaged together#define INA219_CONFIG_MODE_MASK					        0x07
#define	INA219_CONFIG_MODE_POWERDOWN			       	0x00
#define	INA219_CONFIG_MODE_SVOLT_TRIGGERED		   		0x01
#define	INA219_CONFIG_MODE_BVOLT_TRIGGERED		   		0x02
#define	INA219_CONFIG_MODE_SANDBVOLT_TRIGGERED	 		0x03
#define	INA219_CONFIG_MODE_ADCOFF				        0x04
#define	INA219_CONFIG_MODE_SVOLT_CONTINUOUS		   		0x05
#define	INA219_CONFIG_MODE_BVOLT_CONTINUOUS		   		0x06
#define	INA219_CONFIG_MODE_SANDBVOLT_CONTINUOUS  		0x07typedef struct
{I2C_HandleTypeDef 	*ina219_i2c;uint8_t				Address;
} INA219_t;uint8_t INA219_Init(INA219_t *ina219, I2C_HandleTypeDef *i2c, uint8_t Address);
uint16_t INA219_ReadBusVoltage(INA219_t *ina219);
uint16_t INA219_ReadCurrent_mA(INA219_t *ina219);
uint16_t INA219_ReadCurrent_raw(INA219_t *ina219);
uint16_t INA219_ReadShuntVoltage_mV(INA219_t *ina219);
uint16_t INA219_ReadDataForRegister_16Bits(INA219_t *ina219, uint8_t registerAddress);
uint16_t INA219_GetConfigInfo(INA219_t *ina219);void INA219_Reset(INA219_t *ina219);
void INA219_SetCalibration(INA219_t *ina219, uint16_t calibrationData);
void INA219_SetConfig(INA219_t *ina219, uint16_t configData);
void INA219_SetCalibration_16V_8A(INA219_t *ina219);
void INA219_WriteDataToRegister_16Bits(INA219_t *ina219, uint8_t registerAddress, uint16_t Value);#endif //INA219AIDCNR_HELPER_H

3) 测试代码

int main(void)
{/* USER CODE BEGIN 1 */uint16_t vbus, vshunt, current;/* 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_USART1_UART_Init();MX_I2C2_Init();/* USER CODE BEGIN 2 */while(!INA219_Init(&ina219, &hi2c2, INA219_ADDRESS)){}/* USER CODE END 2 *//* Infinite loop *//* USER CODE BEGIN WHILE */while (1){/* USER CODE END WHILE *//* USER CODE BEGIN 3 */vbus = INA219_ReadBusVoltage(&ina219);vshunt = INA219_ReadShuntVoltage_mV(&ina219);current = INA219_ReadCurrent_mA(&ina219);sprintf(strBuffer, "INA219 param: vbus:%d mV; current:%d mA\r\n", vbus, current);HAL_UART_Transmit(&huart1, strBuffer, strlen(strDataBuf), 0xff);UserDelay_ms(500);}

相关文章:

【STM32 开发】| INA219采集电压、电流值

目录 前言1 原理图2 IIC地址说明3 寄存器地址说明4 开始工作前配置5 程序代码1&#xff09;驱动程序2&#xff09;头文件3) 测试代码 前言 INA219 是一款具备 I2C 或 SMBUS 兼容接口的分流器和功率监测计。该器件监测分流器电压降和总线电源电压&#xff0c;转换次数和滤波选项…...

蓝桥杯每日一题203.11.7

题目描述 题目分析 使用dp思维&#xff0c;当前位置是否可行是有上一位置推来&#xff0c;计算出最大的可行位置即可 #include <stdio.h> #include <string.h>#define N 256 int f(const char* s1, const char* s2) {int a[N][N];int len1 strlen(s1);int len2 …...

ESP32建立TCP连接

ESP32建立TCP连接 1.搭建ESP-IDF开发环境 搭建开发环境直接从官网下载即可。 https://docs.espressif.com/projects/esp-idf/zh_CN/v5.1.1/esp32s3/index.html https://dl.espressif.com/dl/esp-idf/?idf4.4 使用官方的下载器下载好&#xff0c;就可以自动安装&#xff0…...

普华永道成功举办《国有基金高质量发展提效创效服务》主题分享活动,助力国有基金提效创效

上海&#xff0c;2023年11月10日 —今天普华永道在上海中国国际进口博览会&#xff08;以下简称“进博会”&#xff09;现场举办《为“国”出力&#xff0c;“普”实有“华”—— 普华永道国有基金高质量发展提效创效服务》主题分享活动&#xff0c;就国有基金监督、管理、投资…...

黑洞路由的几种应用场景

第一种在内网中产生环路&#xff1a; 这种核心交换机上肯定写一条默认路由 0.0.0.0 0 10.0.0.1 出口路由要写一条192.168.0.0 16 10.0.0.2 如果出口路由访问一条不存在的内网网段&#xff0c;又或者访问的那台终端停机了&#xff0c;那就会产生三层环路&#xff0c;数据包在…...

数据分析:智能企业七步曲(一)

原创&#xff1a; MicroStrategy微策略中国 作者&#xff1a;数据杰论 时间走到2018年最后一个季度&#xff0c;过去几年热炒的大数据概念正在各行各业开始落地并展开实际应用&#xff0c;核心是关注数据如何能为企业带来价值。因此&#xff0c;数据分析及其种种实现手段不断被…...

Django ModelSerializer 实现自定义验证详解

随着 Web 开发的日益复杂化&#xff0c;对数据验证的需求也日益增加。Django REST framework 提供了一套强大的、灵活的验证系统&#xff0c;帮助开发者轻松处理各种复杂情况。本文将重点探讨 Django ModelSerializer 中如何实现自定义验证。 1. 简介 Django ModelSerializer…...

在ubuntu sudo apt-get update 更新报错

sudo apt-get update 更新报错 解决办法&#xff1a; 用你自己的key 根据上图自己找 sudo gpg --keyserver keyserver.ubuntu.com --recv-keys **********运行完成有一个ok 见下图 运行命令&#xff0c;中间的还是上面的key复制下来即可 sudo gpg --export --armor **********…...

Linux——手把手教你解决sudo指令无法使用的问题

解决sudo指令无法使用的问题 1. 为什么不能使用 sudo指令能够使某一条指令拥有root权限&#xff0c;即以root权限去执行 例如&#xff1a; sudo ls -l //就是以root权限查看当前目录里的内容但是&#xff0c;如果是新创建的普通账户&#xff0c;一般来说一开始是不能执行s…...

【云原生】使用nginx反向代理后台多服务器

背景 随着业务发展&#xff0c; 用户访问量激增&#xff0c;单台服务器已经无法满足现有的访问压力&#xff0c;研究后需要将后台服务从原来的单台升级为多台服务器&#xff0c;那么原来的访问方式无法满足&#xff0c;所以引入nginx来代理多台服务器&#xff0c;统一请求入口…...

Linux awk命令

除了使用 sed 命令&#xff0c;Linux 系统中还有一个功能更加强大的文本数据处理工具&#xff0c;就是 awk。 曾有人推测 awk 命令的名字来源于 awkward 这个单词。其实不然&#xff0c;此命令的设计者有 3 位&#xff0c;他们的姓分别是 Aho、Weingberger 和 Kernighan&#x…...

南大通用数据库-Gbase-8a-学习-42-定位与释放锁

目录 一、测试版本 二、模拟锁表场景 1、查看自动提交参数 2、关闭自动提交 3、测试表结构 4、测试数据 5、会话一更新数据不提交 6、会话二更新数据卡住 7、会话三查看连接信息 8、会话三查看锁信息 9、解决方法 10、会话一插入数据不提交 11、会话二更新报错 三…...

css绘制常见的一些图形

以下是在CSS中绘制常见图形的示例代码&#xff1a; 线条&#xff1a; .line {width: 100px;height: 1px;background-color: black; }箭头&#xff1a; .arrow {width: 0;height: 0;border-top: 10px solid transparent;border-bottom: 10px solid transparent;border-right:…...

【网络协议】

网络协议 1 网络通讯1.1 防火墙1.2 子网掩码1.3 网关1.4 2 SSH2.1 SSH2.2 SSH12.3 SSH2 3 Telnet4 Telnet/SSL5 NFS6 TFTP7 FTP8 SFTP9 HTTP10 HTTPS11 NAT12 加密 1 网络通讯 1.1 防火墙 所谓“防火墙”&#xff0c;是指一种将内部网和公众访问网(如Internet)分开的方法&…...

如何在JVS低代码表单配置中实现数据的高效管理?

在数字化时代&#xff0c;表单已经成为企业、机构和个人收集、整理、分析数据的重要工具。然而&#xff0c;随着数据复杂性的增长&#xff0c;传统的单一表单往往难以满足需求。JVS低代码表单引擎中子表格允许在主表单中嵌套另一个子表数据&#xff0c;使得数据的收集和组织更加…...

【Python大数据笔记_day04_Hadoop】

分布式和集群 分布式:多台服务器协同配合完成同一个大任务(每个服务器都只完成大任务拆分出来的单独1个子任务) 集群:多台服务器联合起来独立做相同的任务(多个服务器分担客户发来的请求) 注意:集群如果客户端请求量(任务量)多,多个服务器同时处理不同请求(不同任务),如果请求量…...

Android超简单的显示网络图片方法

Android显示网络图片的方法如下&#xff1a; 1、首先&#xff0c;需要在AndroidManifest.xml文件中添加网络权限&#xff1a; <uses-permission android:name"android.permission.INTERNET" /> 2、在布局文件中添加ImageView控件&#xff1a; <ImageVie…...

基于自然语言处理的结构化数据库问答机器人系统

温馨提示&#xff1a;文末有 CSDN 平台官方提供的学长 Wechat / QQ 名片 :) 1. 项目简介 知识库&#xff0c;就是人们总结出的一些历史知识的集合&#xff0c;存储、索引以后&#xff0c;可以被方便的检索出来供后人查询/学习。QnA Maker是用于建立知识库的工具&#xff0c;使用…...

JVM Native内存泄露的排查分析(64M 问题)

我们有一个线上的项目&#xff0c;刚启动完就占用了使用 top 命令查看 RES 占用了超过 1.5G&#xff0c;这明显不合理&#xff0c;于是进行了一些分析找到了根本的原因&#xff0c;下面是完整的分析过程&#xff0c;希望对你有所帮助。 会涉及到下面这些内容 Linux 经典的 64M…...

智能网联汽车基础软件信息安全需求分析

目录 1.安全启动 2.安全升级 3.安全存储 4.安全通信 5.安全调试 6.安全诊断 7.小结 1.安全启动 对于MCU&#xff0c;安全启动主要是以安全岛BootROM为信任根&#xff0c;在MCU启动后&#xff0c;用户程序运行前&#xff0c;硬件加密模块采用逐级校验、并行校验或者混合校…...

KubeSphere 容器平台高可用:环境搭建与可视化操作指南

Linux_k8s篇 欢迎来到Linux的世界&#xff0c;看笔记好好学多敲多打&#xff0c;每个人都是大神&#xff01; 题目&#xff1a;KubeSphere 容器平台高可用&#xff1a;环境搭建与可视化操作指南 版本号: 1.0,0 作者: 老王要学习 日期: 2025.06.05 适用环境: Ubuntu22 文档说…...

vue3 字体颜色设置的多种方式

在Vue 3中设置字体颜色可以通过多种方式实现&#xff0c;这取决于你是想在组件内部直接设置&#xff0c;还是在CSS/SCSS/LESS等样式文件中定义。以下是几种常见的方法&#xff1a; 1. 内联样式 你可以直接在模板中使用style绑定来设置字体颜色。 <template><div :s…...

Caliper 配置文件解析:config.yaml

Caliper 是一个区块链性能基准测试工具,用于评估不同区块链平台的性能。下面我将详细解释你提供的 fisco-bcos.json 文件结构,并说明它与 config.yaml 文件的关系。 fisco-bcos.json 文件解析 这个文件是针对 FISCO-BCOS 区块链网络的 Caliper 配置文件,主要包含以下几个部…...

基于TurtleBot3在Gazebo地图实现机器人远程控制

1. TurtleBot3环境配置 # 下载TurtleBot3核心包 mkdir -p ~/catkin_ws/src cd ~/catkin_ws/src git clone -b noetic-devel https://github.com/ROBOTIS-GIT/turtlebot3.git git clone -b noetic https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git git clone -b noetic-dev…...

push [特殊字符] present

push &#x1f19a; present 前言present和dismiss特点代码演示 push和pop特点代码演示 前言 在 iOS 开发中&#xff0c;push 和 present 是两种不同的视图控制器切换方式&#xff0c;它们有着显著的区别。 present和dismiss 特点 在当前控制器上方新建视图层级需要手动调用…...

GitHub 趋势日报 (2025年06月06日)

&#x1f4ca; 由 TrendForge 系统生成 | &#x1f310; https://trendforge.devlive.org/ &#x1f310; 本日报中的项目描述已自动翻译为中文 &#x1f4c8; 今日获星趋势图 今日获星趋势图 590 cognee 551 onlook 399 project-based-learning 348 build-your-own-x 320 ne…...

MFE(微前端) Module Federation:Webpack.config.js文件中每个属性的含义解释

以Module Federation 插件详为例&#xff0c;Webpack.config.js它可能的配置和含义如下&#xff1a; 前言 Module Federation 的Webpack.config.js核心配置包括&#xff1a; name filename&#xff08;定义应用标识&#xff09; remotes&#xff08;引用远程模块&#xff0…...

【UE5 C++】通过文件对话框获取选择文件的路径

目录 效果 步骤 源码 效果 步骤 1. 在“xxx.Build.cs”中添加需要使用的模块 &#xff0c;这里主要使用“DesktopPlatform”模块 2. 添加后闭UE编辑器&#xff0c;右键点击 .uproject 文件&#xff0c;选择 "Generate Visual Studio project files"&#xff0c;重…...

macOS 终端智能代理检测

&#x1f9e0; 终端智能代理检测&#xff1a;自动判断是否需要设置代理访问 GitHub 在开发中&#xff0c;使用 GitHub 是非常常见的需求。但有时候我们会发现某些命令失败、插件无法更新&#xff0c;例如&#xff1a; fatal: unable to access https://github.com/ohmyzsh/oh…...

JDK 17 序列化是怎么回事

如何序列化&#xff1f;其实很简单&#xff0c;就是根据每个类型&#xff0c;用工厂类调用。逐个完成。 没什么漂亮的代码&#xff0c;只有有效、稳定的代码。 代码中调用toJson toJson 代码 mapper.writeValueAsString ObjectMapper DefaultSerializerProvider 一堆实…...