Arduino平台软硬件原理及使用——开源库的使用

文章目录:
一、库文件的下载及导入
二、库文件源代码说明
三、库文件应用举例

一、库文件的下载及导入

arduino
有关arduino开源库的导入有两种方案:
1.第一种方案需要借助arduino.cc网站来进行查询下载,然后在Arduino软件中进行导入。
2.第二种方案则只需要使用较新版本的Arduino软件(2.2版本之后),在软件中可以直接搜索并导入开源库。

1.在Arduino.cc进行导入库

首先在网页地址框直接输入arduino.cc便可进入网站:
在这里插入图片描述
然后点击上方【DOCUMENTATION】选项:
在这里插入图片描述
在此页面点击左侧【Libraries】选项,便可进入官方收录的库文件页面:
在这里插入图片描述
选择要用的库文件的类目,这里以【display】为例:
在这里插入图片描述
然后点击具体的库文件,以【LiquidCrystal】为例:
在这里插入图片描述
进入库文件下载目录后,直接点击要用的版本号即可直接下载。
下载完成后如果不是压缩包,最好压缩成zip文件:
在这里插入图片描述
最后打开Arduino软件,选择【项目】-【导入库】-【添加.ZIP库】然后选择对应的zip文件即可导入成功。

2.使用Arduino软件导入库

上述方案较为复杂,所以建议使用较新版本的Arduino软件直接导入库:
在这里插入图片描述
在此版本的软件中直接点选左侧的“书籍”样式的图标(其表示为库文件),然后直接在搜索框查找要使用的库文件名,选择对应库文件及版本点击安装即可。
这种方案则最为简洁,当然有些时候要使用的库在软件中查询不到,此时就需要采用第一种方案进行导入。

2、库文件源代码说明

在这里插入图片描述
如上图所示,一般库文件中会有如上几个文件(会存在些许不同)。

1.示例程序的使用

example文件即为【示例】,这里面会有开源文件贡献者编写的几个示例程序,用于帮助学习者理解库的使用:
在这里插入图片描述
当然只要将库文件导入过Arduino中,也可以在Arduino软件中打开相应的示例程序:
在这里插入图片描述

2.【.h文件】及【.cpp】文件说明

在【src】文件夹中存在以下两个文件:
【.h】后缀我们称之为头文件,【.cpp】后缀我们称之为源文件
在这里插入图片描述

头文件通常包含类声明函数原型宏定义全局变量声明等。它们的目的是提供一种方式来共享代码,并确保在多个源文件中使用一致的声明:

/*
  HCSR04 - Library for arduino, for HC-SR04 ultrasonic distance sensor.
  Created by Dirk Sarodnick, 2020.
*/

#ifndef HCSR04_H
#define HCSR04_H

#include "Arduino.h"

#define HCSR04_INVALID_RESULT  -1;
#define HCSR04_NO_TRIGGER      -2;
#define HCSR04_NO_ECHO         -3;

class HCSR04Sensor {
	public:
		HCSR04Sensor();
		~HCSR04Sensor();

		typedef enum eUltraSonicUnlock {
			unlockSkip = 0,
			unlockMaybe = 1,
			unlockForced = 2
		} eUltraSonicUnlock_t;
		
		void begin(uint8_t triggerPin, uint8_t echoPin) { begin(triggerPin, new uint8_t[1]{ echoPin }, 1); }
		void begin(uint8_t triggerPin, uint8_t* echoPins, uint8_t echoCount) { begin(triggerPin, echoPins, echoCount, 100000, eUltraSonicUnlock_t::unlockSkip); }
		void begin(uint8_t triggerPin, uint8_t echoPin, uint32_t timeout, eUltraSonicUnlock_t unlock) { begin(triggerPin, new uint8_t[1]{ echoPin }, 1, timeout, unlock); }
		void begin(uint8_t triggerPin, uint8_t* echoPins, uint8_t echoCount, uint32_t timeout, eUltraSonicUnlock_t unlock) { begin(triggerPin, echoPins, echoCount, timeout, 10, 10, unlock); }
		void begin(uint8_t triggerPin, uint8_t* echoPins, uint8_t echoCount, uint32_t timeout, uint16_t triggerTime, uint16_t triggerWait, eUltraSonicUnlock_t unlock);
		void end();
		
		long* measureMicroseconds() { measureMicroseconds(lastMicroseconds); return lastMicroseconds; }
		void measureMicroseconds(long* results);

		double* measureDistanceMm() { measureDistanceMm(defaultTemperature, lastDistances); return lastDistances; }
		void measureDistanceMm(double* results) { measureDistanceMm(defaultTemperature, results == NULL ? lastDistances : results); }
		double* measureDistanceMm(float temperature) { measureDistanceMm(temperature, lastDistances); return lastDistances; }
		void measureDistanceMm(float temperature, double* results);

		double* measureDistanceCm() { measureDistanceCm(defaultTemperature, lastDistances); return lastDistances; }
		void measureDistanceCm(double* results) { measureDistanceCm(defaultTemperature, results == NULL ? lastDistances : results); }
		double* measureDistanceCm(float temperature) { measureDistanceCm(temperature, lastDistances); return lastDistances; }
		void measureDistanceCm(float temperature, double* results);

		double* measureDistanceIn() { measureDistanceIn(defaultTemperature, lastDistances); return lastDistances; }
		void measureDistanceIn(double* results) { measureDistanceIn(defaultTemperature, results == NULL ? lastDistances : results); }
		double* measureDistanceIn(float temperature) { measureDistanceIn(temperature, lastDistances); return lastDistances; }
		void measureDistanceIn(float temperature, double* results);
		
		static void triggerInterrupt0(void);
		static void triggerInterrupt1(void);
		static void triggerInterrupt2(void);
		static void triggerInterrupt3(void);
		static void triggerInterrupt4(void);
		static void triggerInterrupt5(void);
		static void triggerInterrupt6(void);
		static void triggerInterrupt7(void);
		static void triggerInterrupt8(void);
		static void triggerInterrupt9(void);
		
		static void echoInterrupt0(void);
		static void echoInterrupt1(void);
		static void echoInterrupt2(void);
		static void echoInterrupt3(void);
		static void echoInterrupt4(void);
		static void echoInterrupt5(void);
		static void echoInterrupt6(void);
		static void echoInterrupt7(void);
		static void echoInterrupt8(void);
		static void echoInterrupt9(void);
	
	private:
		float defaultTemperature = 19.307;
		long* lastMicroseconds;
		double* lastDistances;

		uint32_t timeout;
		uint16_t triggerTime = 10; // HC-SR04 needs at least 10�s trigger. Others may need longer trigger pulses.
		uint16_t triggerWait = 10; // HC-SR04 sends its signal about 200�s. We only wait a small amount to reduce interference, but to not miss anything on slower clock speeds.
		volatile uint8_t triggerPin;
		volatile unsigned long* volatile triggerTimes;
		
		uint8_t echoCount;
		volatile int16_t* volatile echoStages;
		volatile int16_t* volatile echoInts;
		volatile int16_t* volatile echoPorts;
		volatile unsigned long* volatile echoTimes;
		
		void triggerInterrupt(uint8_t);
		void echoInterrupt(uint8_t);
		void unlockSensors(eUltraSonicUnlock_t, uint8_t*);
};

extern HCSR04Sensor HCSR04;

#endif // HCSR04_H

源文件包含了实现代码,即函数和方法的定义。它们通常包含与头文件对应的实现:

/*
  HCSR04 - Library for arduino, for HC-SR04 ultrasonic distance sensor.
  Created by Dirk Sarodnick, 2020.
*/

#include "Arduino.h"
#include "HCSR04.h"

HCSR04Sensor::HCSR04Sensor() {}
HCSR04Sensor::~HCSR04Sensor() { this->end(); }

void HCSR04Sensor::begin(uint8_t triggerPin, uint8_t* echoPins, uint8_t echoCount, uint32_t timeout, uint16_t triggerTime, uint16_t triggerWait, eUltraSonicUnlock_t unlock) {
	if (this->echoCount != echoCount) this->end();
	
	this->triggerPin = triggerPin;
	pinMode(triggerPin, OUTPUT);

	this->timeout = timeout;
	this->triggerTime = triggerTime;
	this->triggerWait = triggerWait;
	this->echoCount = echoCount;
	
	if (this->lastMicroseconds == NULL) this->lastMicroseconds = new long[echoCount];
	if (this->lastDistances == NULL) this->lastDistances = new double[echoCount];
	
	if (this->triggerTimes == NULL) this->triggerTimes = new unsigned long[echoCount];
	if (this->echoTimes == NULL) this->echoTimes = new unsigned long[echoCount];

	if (this->echoStages == NULL) this->echoStages = new int16_t[echoCount];
	if (this->echoInts == NULL) this->echoInts = new int16_t[echoCount];
	if (this->echoPorts == NULL) this->echoPorts = new int16_t[echoCount];

	for (uint8_t i = 0; i < this->echoCount; i++) {
		this->triggerTimes[i] = 0;
		this->echoTimes[i] = 0;

		int16_t interrupt = digitalPinToInterrupt(echoPins[i]);
		if (interrupt == NOT_AN_INTERRUPT) {
			this->echoStages[i] = -1;
			this->echoInts[i] = -1;
			this->echoPorts[i] = echoPins[i];
		} else {
			this->echoStages[i] = 0;
			this->echoInts[i] = interrupt;
			this->echoPorts[i] = -1;
		}

		pinMode(echoPins[i], INPUT);
	}
	
	// Unlock sensors that are possibly in a locked state, if this feature is enabled.
	this->unlockSensors(unlock, echoPins);
}

void HCSR04Sensor::end() {
	if (this->lastMicroseconds != NULL) delete []this->lastMicroseconds;
	if (this->lastDistances != NULL) delete []this->lastDistances;
	if (this->triggerTimes != NULL) delete []this->triggerTimes;
	if (this->echoTimes != NULL) delete []this->echoTimes;
	
	if (this->echoPorts != NULL) delete []this->echoPorts;
	if (this->echoInts != NULL) delete []this->echoInts;
	if (this->echoStages != NULL) delete []this->echoStages;
	
	this->lastMicroseconds = NULL;
	this->lastDistances = NULL;
	this->triggerTimes = NULL;
	this->echoTimes = NULL;
	this->echoPorts = NULL;
	this->echoInts = NULL;
	this->echoStages = NULL;
}

void HCSR04Sensor::measureMicroseconds(long* results) {
	if (results == NULL) results = this->lastMicroseconds;

	bool finished = true;
	bool waiting = true;
	unsigned long startMicros = micros();
	unsigned long currentMicros = 0;
	unsigned long elapsedMicros = 0;

	// Make sure that trigger pin is LOW.
	digitalWrite(triggerPin, LOW);
	delayMicroseconds(4);
	
	// Hold trigger HIGH for 10 microseconds (default), which signals the sensor to measure distance.
	digitalWrite(triggerPin, HIGH);
	delayMicroseconds(this->triggerTime);

	// Set trigger LOW again and wait to give the sensor time for sending the signal without interference
	digitalWrite(triggerPin, LOW);
	delayMicroseconds(this->triggerWait);
	
	// Attach interrupts to echo pins for the starting point
	for (uint8_t i = 0; i < this->echoCount; i++) {
		if (this->echoInts[i] >= 0 && this->echoStages[i] == 0) {
			this->echoStages[i] = 1;
			switch (i) {
				case 0: attachInterrupt(this->echoInts[i], &triggerInterrupt0, RISING); break;
				case 1: attachInterrupt(this->echoInts[i], &triggerInterrupt1, RISING); break;
				case 2: attachInterrupt(this->echoInts[i], &triggerInterrupt2, RISING); break;
				case 3: attachInterrupt(this->echoInts[i], &triggerInterrupt3, RISING); break;
				case 4: attachInterrupt(this->echoInts[i], &triggerInterrupt4, RISING); break;
				case 5: attachInterrupt(this->echoInts[i], &triggerInterrupt5, RISING); break;
				case 6: attachInterrupt(this->echoInts[i], &triggerInterrupt6, RISING); break;
				case 7: attachInterrupt(this->echoInts[i], &triggerInterrupt7, RISING); break;
				case 8: attachInterrupt(this->echoInts[i], &triggerInterrupt8, RISING); break;
				case 9: attachInterrupt(this->echoInts[i], &triggerInterrupt9, RISING); break;
			}
		}
	}
	
	// Wait until all echos are returned or timed out.
	while(true) {
		delayMicroseconds(1);
		
		finished = true;
		waiting = true;
		currentMicros = micros();
		elapsedMicros = currentMicros - startMicros;

		for (uint8_t i = 0; i < this->echoCount; i++) {
			waiting &= elapsedMicros < this->timeout || (this->triggerTimes[i] > 0 && this->echoTimes[i] == 0 && (currentMicros - this->triggerTimes[i]) < this->timeout);

			if (this->echoPorts[i] >= 0 && this->triggerTimes[i] == 0) {
				if (digitalRead(this->echoPorts[i]) == HIGH) this->triggerTimes[i] = micros();
			}

			if (this->triggerTimes[i] > 0 || !waiting) {
				if (this->echoInts[i] >= 0 && (this->echoStages[i] == 1 || !waiting)) {
					if (this->echoStages[i] == 1) this->echoStages[i] = 2;
					detachInterrupt(this->echoInts[i]);
				}
			} else finished &= false;

			if (this->echoInts[i] >= 0 && this->triggerTimes[i] > 0 && this->echoStages[i] == 2 && waiting) {
				this->echoStages[i] = 3;
				switch (i) {
					case 0: attachInterrupt(this->echoInts[i], &echoInterrupt0, FALLING); break;
					case 1: attachInterrupt(this->echoInts[i], &echoInterrupt1, FALLING); break;
					case 2: attachInterrupt(this->echoInts[i], &echoInterrupt2, FALLING); break;
					case 3: attachInterrupt(this->echoInts[i], &echoInterrupt3, FALLING); break;
					case 4: attachInterrupt(this->echoInts[i], &echoInterrupt4, FALLING); break;
					case 5: attachInterrupt(this->echoInts[i], &echoInterrupt5, FALLING); break;
					case 6: attachInterrupt(this->echoInts[i], &echoInterrupt6, FALLING); break;
					case 7: attachInterrupt(this->echoInts[i], &echoInterrupt7, FALLING); break;
					case 8: attachInterrupt(this->echoInts[i], &echoInterrupt8, FALLING); break;
					case 9: attachInterrupt(this->echoInts[i], &echoInterrupt9, FALLING); break;
				}
			}

			if (this->echoPorts[i] >= 0 && this->triggerTimes[i] > 0 && this->echoTimes[i] == 0) {
				if (digitalRead(this->echoPorts[i]) == LOW) this->echoTimes[i] = micros();
			}
			
			if ((this->triggerTimes[i] > 0 && this->echoTimes[i] > 0) || !waiting) {
				if (this->echoInts[i] >= 0 && (this->echoStages[i] == 3 || !waiting)) {
					if (this->echoStages[i] == 3) this->echoStages[i] = 4;
					detachInterrupt(this->echoInts[i]);
				}
			} else finished &= false;
		}
		
		if (!waiting || finished) break;
	}
	
	// Determine the durations of each sensor.
	for (uint8_t i = 0; i < this->echoCount; i++) {
		if (this->echoInts[i] >= 0) this->echoStages[i] = 0;
		if (this->triggerTimes[i] > 0 && this->echoTimes[i] > 0) {
			long resultTime = this->echoTimes[i] - this->triggerTimes[i];
			results[i] = resultTime > 0 ? resultTime : HCSR04_INVALID_RESULT;
		} else if (this->triggerTimes[i] > 0) {
			results[i] = HCSR04_NO_ECHO;
		} else {
			results[i] = HCSR04_NO_TRIGGER;
		}

		this->triggerTimes[i] = 0;
		this->echoTimes[i] = 0;
	}
}

void HCSR04Sensor::measureDistanceMm(float temperature, double* results) {
	if (results == NULL) results = this->lastDistances;

	double speedOfSoundInMmPerMs = (331.3 + 0.606 * temperature) / 1000; // Cair ≈ (331.3 + 0.606 ⋅ ϑ) m/s
	long* times = measureMicroseconds();
	
	// Calculate the distance in mm for each result.
	for (uint8_t i = 0; i < this->echoCount; i++) {
		double distanceMm = times[i] / 2.0 * speedOfSoundInMmPerMs;
		if (distanceMm < 10 || distanceMm > 4000) {
			results[i] = HCSR04_INVALID_RESULT;
		} else {
			results[i] = distanceMm;
		}
	}
}

void HCSR04Sensor::measureDistanceCm(float temperature, double* results) {
	if (results == NULL) results = this->lastDistances;

	double speedOfSoundInCmPerMs = (331.3 + 0.606 * temperature) / 1000 / 10; // Cair ≈ (331.3 + 0.606 ⋅ ϑ) m/s
	long* times = measureMicroseconds();
	
	// Calculate the distance in cm for each result.
	for (uint8_t i = 0; i < this->echoCount; i++) {
		double distanceCm = times[i] / 2.0 * speedOfSoundInCmPerMs;
		if (distanceCm < 1 || distanceCm > 400) {
			results[i] = HCSR04_INVALID_RESULT;
		} else {
			results[i] = distanceCm;
		}
	}
}

void HCSR04Sensor::measureDistanceIn(float temperature, double* results) {
	if (results == NULL) results = this->lastDistances;

	double speedOfSoundInCmPerMs = (331.3 + 0.606 * temperature) * 39.37007874 / 1000 / 1000; // Cair ≈ (331.3 + 0.606 ⋅ ϑ) m/s
	long* times = measureMicroseconds();

	// Calculate the distance in cm for each result.
	for (uint8_t i = 0; i < this->echoCount; i++) {
		double distanceIn = times[i] / 2.0 * speedOfSoundInCmPerMs;
		if (distanceIn < 1 || distanceIn > 157.4804) {
			results[i] = HCSR04_INVALID_RESULT;
		}
		else {
			results[i] = distanceIn;
		}
	}
}

void HCSR04Sensor::unlockSensors(eUltraSonicUnlock_t unlock, uint8_t* echoPins) {
	if (unlock == eUltraSonicUnlock_t::unlockSkip) return;
	bool hasLocked = false;

	// Check if any sensor is in a locked state and unlock it if necessary.
	for (uint8_t i = 0; echoPins[i] != 0; i++) {
		if (unlock == eUltraSonicUnlock_t::unlockMaybe && digitalRead(echoPins[i]) == LOW) continue;
		pinMode(echoPins[i], OUTPUT);
		digitalWrite(echoPins[i], LOW);
		hasLocked = true;
	}
	
	if (hasLocked) delay(100);

	// Revert the pinMode after potential unlocking.
	for (uint8_t i = 0; echoPins[i] != 0; i++) {
		pinMode(echoPins[i], INPUT);
	}
	
	if (hasLocked) delay(100);
}

void HCSR04Sensor::triggerInterrupt(uint8_t index) {
	if (this->triggerTimes[index] == 0) this->triggerTimes[index] = micros();
}

void HCSR04Sensor::echoInterrupt(uint8_t index) {
	if (this->triggerTimes[index] > 0 && this->echoTimes[index] == 0) this->echoTimes[index] = micros();
}

void HCSR04Sensor::triggerInterrupt0() { HCSR04.triggerInterrupt(0); }
void HCSR04Sensor::triggerInterrupt1() { HCSR04.triggerInterrupt(1); }
void HCSR04Sensor::triggerInterrupt2() { HCSR04.triggerInterrupt(2); }
void HCSR04Sensor::triggerInterrupt3() { HCSR04.triggerInterrupt(3); }
void HCSR04Sensor::triggerInterrupt4() { HCSR04.triggerInterrupt(4); }
void HCSR04Sensor::triggerInterrupt5() { HCSR04.triggerInterrupt(5); }
void HCSR04Sensor::triggerInterrupt6() { HCSR04.triggerInterrupt(6); }
void HCSR04Sensor::triggerInterrupt7() { HCSR04.triggerInterrupt(7); }
void HCSR04Sensor::triggerInterrupt8() { HCSR04.triggerInterrupt(8); }
void HCSR04Sensor::triggerInterrupt9() { HCSR04.triggerInterrupt(9); }

void HCSR04Sensor::echoInterrupt0() { HCSR04.echoInterrupt(0); }
void HCSR04Sensor::echoInterrupt1() { HCSR04.echoInterrupt(1); }
void HCSR04Sensor::echoInterrupt2() { HCSR04.echoInterrupt(2); }
void HCSR04Sensor::echoInterrupt3() { HCSR04.echoInterrupt(3); }
void HCSR04Sensor::echoInterrupt4() { HCSR04.echoInterrupt(4); }
void HCSR04Sensor::echoInterrupt5() { HCSR04.echoInterrupt(5); }
void HCSR04Sensor::echoInterrupt6() { HCSR04.echoInterrupt(6); }
void HCSR04Sensor::echoInterrupt7() { HCSR04.echoInterrupt(7); }
void HCSR04Sensor::echoInterrupt8() { HCSR04.echoInterrupt(8); }
void HCSR04Sensor::echoInterrupt9() { HCSR04.echoInterrupt(9); }

HCSR04Sensor HCSR04;

三、库文件应用举例

下文以超声波传感器的库HCSR04来进行举例(仅说明代码用法,不作实物接线)
在导入HCSR04库之后,可打开库文件中的实例:

#include <HCSR04.h>

HCSR04 hc(5, 6); //initialisation class HCSR04 (trig pin , echo pin)
                 //初始化超声波传感器,即表明接口号。

void setup()
{
    Serial.begin(9600);  //串口初始化
}

void loop()
{
    Serial.println(hc.dist()); // return curent distance in serial
                               // hc.dist()会返回超声波传感器检测的距离数据
    delay(60);                 // 延时60毫秒
}

具体实例可参考文章——Arduino项目式编程教学第四章——超声波测距

如果想要了解此库文件下的方法,则可以在Arduino软件中,按住【Alt / cmd】键,然后使用鼠标点击对应的库文件名,即可打开其头文件
在这里插入图片描述
在这里插入图片描述
在头文件中,可以阅读文件贡献者做出的注释来了解此库文件中可供使用的方法。

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

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

相关文章

【学习计划】文献阅读:癌症生物标志物文献综述

Cancer biomarkers: Emerging trends and clinical implications for personalized treatment 标题英文&#xff1a;Cancer biomarkers: Emerging trends and clinical implications for personalized treatment 标题中文&#xff1a;癌症生物标志物 &#xff1a; 个性化治疗的…

Axure RP 9 安装详细笔记

一、下载 1.官网下载地址 Axure RP 9 MAC正式版&#xff1a;https://axure.cachefly.net/versions/9-0/AxureRP-Setup-3740.dmgAxure RP 9 WINDOWS正式版&#xff1a;https://axure.cachefly.net/versions/9-0/AxureRP-Setup-3740.exe2.网盘下载 链接&#xff1a;https://pa…

计算机SCI期刊,中科院3区,1个月录用,易过审

一、期刊名称 Visual Computer 二、期刊简介概况 期刊类型&#xff1a;SCI 学科领域&#xff1a;计算机科学 影响因子&#xff1a;3.5 中科院分区&#xff1a;3区 三、期刊简介 视觉计算机发表有关捕获、识别、建模、分析和生成形状和图像的所有研究领域的文章。 计算机…

【ai】tx2 nx: yolov4-triton-tensorrt 成功部署server

isarsoft / yolov4-triton-tensorrt运行发现插件未注册? 【ai】tx2 nx: jetson Triton Inference Server 部署YOLOv4 【ai】tx2 nx: jetson Triton Inference Server 运行YOLOv4 对main 进行了重新构建 【ai】tx2 nx :ubuntu查找NvInfer.h 路径及哪个包、查找符号【ai】tx2…

基于SpringBoot+Vue电商平台系统(带 1w+字文档)

基于SpringBootVue电商平台系统(带 1w字文档) 本课题研究和开发电商平台&#xff0c;让安装在计算机上的该系统变成管理人员的小帮手&#xff0c;提高商品交易信息处理速度&#xff0c;规范商品交易信息处理流程&#xff0c;让管理人员的产出效益更高。 项目简介 基于SpringBo…

go语言day06 数组 切片

数组 : 定长且元素类型一致,在索引逻辑上连续存储,数组的内存地址是存储的第一个元素的内存地址 几种创建方式: 仅声明 var nums [ 3 ] int 声明并赋值 var nums [ 2 ] string {"武沛齐","alex"} 声明并按下标赋值 var nums [ 3 ] int {0:88,2:1 } 省略…

如何一步一步将Python中的应用打包成安卓的APK安装包文件

一、首先&#xff0c;按照如下链接操作 Python 应用打包成 APK【全流程】_python打包成apk-CSDN博客 二、运行 buildozer init会报错buildozer命令找不到&#xff0c;明明已经安装 解决方法&#xff1a; 这里重新创建一个conda环境 Installation — Buildozer 0.11 docum…

西门子840dsl机床仿真软件配置opcua说明

需要的安装包如下&#xff0c;可在百度网盘中下载 主软件包&#xff1a;sinutrain-v4.7-ed4&#xff08;也可在官网中下载最新版本&#xff09; 用户文件&#xff1a;UserDataBase 授权sinutrain&#xff1a;Sim_EKB_Install_2021_06_22 链接&#xff1a;https://pan.baidu.c…

13款最佳“IP地址管理”软件,哪个是你的最爱?

号主&#xff1a;老杨丨11年资深网络工程师&#xff0c;更多网工提升干货&#xff0c;请关注公众号&#xff1a;网络工程师俱乐部 中午好&#xff0c;我的网工朋友。 随着网络规模的不断扩展和复杂化&#xff0c;IP地址的管理变得越来越复杂。一个不小心&#xff0c;就可能出现…

仓库管理系统09--修改用户密码

1、添加窗体 2、窗体布局控件 UI设计这块还是传统的表格布局&#xff0c;采用5行2列 3、创建viewmodel 4、前台UI绑定viewmodel 这里要注意属性绑定和命令绑定及命令绑定时传递的参数 <Window x:Class"West.StoreMgr.Windows.EditPasswordWindow"xmlns"http…

vxe-表尾单元格进行合并后更改其表尾背景颜色

1.场景 在vxe-table的官网API中可以使用footer-cell-class-name给单元格添加背景颜色或者其他样式&#xff0c;但是本人场景进行了表尾合并的操作&#xff1b;参考API进行更改背景颜色失败&#xff1b; 2.解决 利用表尾css类名的区别&#xff0c;用子类选择器进行对应的选择设…

生产环境出现问题,测试人如何做工作复盘?

很多时候我们能把大部分的Bug或一些部署等问题在业务上线之前就解决了&#xff0c;但由于某些因素&#xff0c;线上问题还是时而出现&#xff0c;影响业务生产甚至是公司效益。 避免线上问题的发生以及线上问题及时处理是测试人员的一项重要职责&#xff0c;如何快速地处理&am…

Pycharm 启动 Django项目 —— python篇

1、打开你的工程&#xff0c;在菜单栏里找到Run-->Edit Configurations 2、在打开的对话框里边选择Python&#xff0c;点击号 3.选择Python 4.出现了一个新的项Unnamed&#xff0c;你可以把它改名叫debug&#xff0c;好听一点 5.脚本选择你网站的manage.py&#xff0c;脚本参…

UDP-Hunter:针对各种UDP服务的网络安全评估工具

关于UDP-Hunter UDP-Hunter是一款功能强大的UDP服务安全评估工具&#xff0c;该工具可以覆盖IPv4和IPv6协议。 UDP扫描一直是一项缓慢而痛苦的工作&#xff0c;如果你打算在UDP的基础上添加IPv6支持&#xff0c;那么可选的工具就会非常有限。UDP-Hunter是一个基于Python的开源…

车辆数据的提取、定位和融合 精确车辆定位(其三.一 共十二篇)随机复合

第一篇&#xff1a; System Introduction 第二篇&#xff1a;State of the Art 第三篇&#xff1a;localization 第四篇&#xff1a;Submapping and temporal weighting 第五篇&#xff1a;Mapping of Point-shaped landmark data 第六篇&#xff1a;Clustering of landma…

2024.6.25力扣刷题记录-周赛403

目录 一、3194. 最小元素和最大元素的最小平均值 二、3195. 包含所有 1 的最小矩形面积 I 三、3196. 最大化子数组的总成本 四、3197. 包含所有 1 的最小矩形面积 II 博主在比赛时只过了前两题。剩下跟着灵神做&#xff0c;来自视频&#xff1a; 【状态机 DP【力扣周赛 403…

策略模式-通过枚举newInstance替代工厂

策略模式-使用枚举newInstance 前言一、枚举类&#xff1a;MarkCheckDataTypeEnum二、抽象类&#xff1a;AbstractMarkChecker三、检查类&#xff1a;MarkPeopleChecker四、demo演示总结 前言 很久没写文章了~~ 吐槽下&#xff1a;入职新公司后&#xff0c;基本在搬砖&#xf…

CppInsights: 学习C++模版的神器

CppInsights&#xff1a;深入理解C代码的利器 C是一门强大而复杂的编程语言&#xff0c;其复杂性主要体现在语言的多层次抽象和丰富的语法特性上。尽管这些特性使得C能够高效地处理复杂的任务&#xff0c;但也给开发者带来了理解和调试代码的巨大挑战。CppInsights正是在这一背…

RabbitMQ(消息队列)

RabbitMQ 它是消息中间件&#xff0c;是在消息的传输过程中保存消息的容器&#xff0c;实现应用程序和应用程序之间通信的中间产品。目前主流消息队列通讯协议是AMQP&#xff08;二进制传输&#xff0c;支持多种语言&#xff09;、JMS&#xff08;HTTP传输&#xff0c;只支持J…

【PyQt5】一文向您详细介绍 setSpacing() 的作用

【PyQt5】一文向您详细介绍 setSpacing() 的作用 下滑即可查看博客内容 &#x1f308; 欢迎莅临我的个人主页 &#x1f448;这里是我静心耕耘深度学习领域、真诚分享知识与智慧的小天地&#xff01;&#x1f387; &#x1f393; 博主简介&#xff1a;985高校的普通本硕&am…