Arduino 项目笔记 |TH1621 LCD液晶显示屏驱动(SSOP-24封装)

news2024/11/22 13:21:33

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述


LCD液晶屏资料

LCD液晶屏资料

在这里插入图片描述

重要参数:

  • 工作电压: 3V
  • 可视角度:120°
  • 1/4 ,1/3

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述


TH1621 驱动

HT1621 LCD控制驱动芯片介绍

VLCD 和 VCC 电压符合规格书,最好都取3.3V 。电压太高或太低都会出现段码液晶屏乱码的情况,要么多一笔,要么若隐若现的显示一笔。

在这里插入图片描述

TH1621.h

/*******************************************************************************
Copyright 2016-2018 anxzhu (github.com/anxzhu)
Copyright 2018-2020 Valerio Nappi (github.com/valerionew) (changes)
Based on segment-lcd-with-ht1621 from anxzhu (2016-2018)
(https://github.com/anxzhu/segment-lcd-with-ht1621)

Partially rewritten and extended by Valerio Nappi (github.com/valerionew) in 2018

This file is part of the HT1621 arduino library, and thus under the MIT license.
More info on the project and the license conditions on :
https://github.com/valerionew/ht1621-7-seg

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

*******************************************************************************/

#ifndef HT1621_H_
#define HT1621_H_   //防止重复包含

const unsigned char  LCDCODE[11]={0xFA,0x0A,0xBC,0x9E,0x4E,0xD6,0xF6,0x8A,0xFE,0xDE,0x00};  // LCDCODE[10] = 0x00  不显示任何东西


#define  BIAS     0x52             //0b1000 0101 0010  1/3duty 4com
#define  SYSDIS   0X00             //0b1000 0000 0000  关振系统荡器和LCD偏压发生器
#define  SYSEN    0X02             //0b1000 0000 0010 打开系统振荡器
#define  LCDOFF   0X04             //0b1000 0000 0100  关LCD偏压
#define  LCDON    0X06             //0b1000 0000 0110  打开LCD偏压
#define  XTAL     0x28             //0b1000 0010 1000 外部接时钟
#define  RC256    0X30             //0b1000 0011 0000  内部时钟
#define  TONEON   0X12             //0b1000 0001 0010  打开声音输出
#define  TONEOFF  0X10             //0b1000 0001 0000 关闭声音输出
#define  WDTDIS1  0X0A             //0b1000 0000 1010  禁止看门狗
#define  BUFFERSIZE 12

// #define HT1621_DEBUG


class  HT1621
{
public:
	HT1621();
	void begin(int cs_p, int wr_p, int data_p, int backlight_p);
	void begin(int cs_p, int wr_p, int data_p);
	void clear();
	void backlight();
	void noBacklight();
	void setBatteryLevel(int level,unsigned char *s);
	void print(long num, const char* flags="%6li", int precision = 0);
	void print(double num, int precision = 3);
	void printCelsius(double num); // precision is always 1
	void print(const char* str, bool leftPadded = false);
	void display();
	void noDisplay();
private:
	int _cs_p;
	int _wr_p;
	int _data_p;
	int _backlight_p;
	bool _backlight_en;
	char _buffer[BUFFERSIZE];
	unsigned char _battery[3];
	void wrone(unsigned char addr, unsigned char sdata);
	void wrclrdata(unsigned char addr, unsigned char sdata);
	void wrCLR(unsigned char len);
	void wrDATA(unsigned char data, unsigned char cnt);
	void wrCMD(unsigned char CMD);
	void setdecimalseparator(int dpposition);
	void config(); // legacy: why not in begin func
	void update();
	char charToSegBits(char character);
};
#endif

HT1621.cpp

/*******************************************************************************
Copyright 2016-2018 anxzhu (github.com/anxzhu)
Copyright 2018-2020 Valerio Nappi (github.com/5N44P) (changes)
Based on segment-lcd-with-ht1621 from anxzhu (2016-2018)
(https://github.com/anxzhu/segment-lcd-with-ht1621)

Partially rewritten and extended by Valerio Nappi (github.com/5N44P) in 2018

This file is part of the HT1621 arduino library, and thus under the MIT license.
More info on the project and the license conditions on :
https://github.com/5N44P/ht1621-7-seg

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

*******************************************************************************/

#include <Arduino.h>
#include "HT1621.h"

HT1621::HT1621(){
	_buffer[0] = 0x00;
	_buffer[1] = 0x00;
	_buffer[2] = 0x00;
	_buffer[3] = 0x00;
	_buffer[4] = 0x00;
	_buffer[5] = 0x00;
	_buffer[6] = 0x00;
}

void HT1621::begin(int cs_p, int wr_p, int data_p, int backlight_p)
{
	pinMode(cs_p, OUTPUT);
	pinMode(wr_p, OUTPUT);
	pinMode(data_p, OUTPUT);
	pinMode(backlight_p, OUTPUT);
	_cs_p=cs_p;
	_wr_p=wr_p;
	_data_p=data_p;
	_backlight_p=backlight_p;
	_backlight_en=true;
	config();
}

void HT1621::begin(int cs_p, int wr_p, int data_p)
{
	pinMode(cs_p, OUTPUT);
	pinMode(wr_p, OUTPUT);
	pinMode(data_p, OUTPUT);
	_cs_p=cs_p;
	_wr_p=wr_p;
	_data_p=data_p;
	_backlight_en = false;
	config();
}

void HT1621::wrDATA(unsigned char data, unsigned char cnt) {
	unsigned char i;
	for (i = 0; i < cnt; i++) {
		digitalWrite(_wr_p, LOW);
		delayMicroseconds(4);
		if (data & 0x80) {
			digitalWrite(_data_p, HIGH);
		}
		else {
			digitalWrite(_data_p, LOW);
		}
		digitalWrite(_wr_p, HIGH);
		delayMicroseconds(4);
		data <<= 1;
	}
}
void HT1621::wrclrdata(unsigned char addr, unsigned char sdata)
{
	addr+=9;
	addr <<= 2;
	digitalWrite(_cs_p, LOW);
	wrDATA(0xa0, 3);
	wrDATA(addr, 6);
	wrDATA(sdata, 8);
	digitalWrite(_cs_p, HIGH);
}

void HT1621::display()
{
	wrCMD(LCDON);
}

void HT1621::noDisplay()
{
	wrCMD(LCDOFF);
}

// 写数据到RAM命令格式为:101+6位RAM地址+4位数据,其中RAM地址为SEG序号 (参考:https://blog.csdn.net/qq_36347513/article/details/107330387)
// 
void HT1621::wrone(unsigned char addr, unsigned char sdata)// 101 数据模式  读写之间变换
{
	addr+=9;// HT1621 SSOP-24 芯片的SEG脚从SEG9开始的 ,所以addr+9;
	addr <<= 2;
	digitalWrite(_cs_p, LOW);
	wrDATA(0xa0, 3);// 101 
	wrDATA(addr, 6);
	wrDATA(sdata, 8);   // 0XF7  "8"  
	digitalWrite(_cs_p, HIGH);
}

// void HT1621::update(){
	 the buffer is backwards with respect to the lcd. could be improved
	// wrone(0, _buffer[5]);
	// wrone(2, _buffer[4]);
	// wrone(4, _buffer[3]);
	// wrone(6, _buffer[2]);
	// wrone(8, _buffer[1]);
	// wrone(10,_buffer[0]);
// }
void HT1621::backlight()
{
	if (_backlight_en)
		digitalWrite(_backlight_p, HIGH);
	delay(1);
}

void HT1621::noBacklight()
{
	if(_backlight_en)
		digitalWrite(_backlight_p, LOW);
	delay(1);
}

void HT1621::wrCMD(unsigned char CMD) {  //100 命令模式
	digitalWrite(_cs_p, LOW);
	wrDATA(0x80, 4);
	wrDATA(CMD, 8);
	digitalWrite(_cs_p, HIGH);
}

void HT1621::config()
{
	wrCMD(BIAS);
	wrCMD(RC256);
	wrCMD(SYSDIS);
	wrCMD(WDTDIS1);
	wrCMD(SYSEN);
	wrCMD(LCDON);
}

// #define  BIAS     0x52             //0b1000 0101 0010  1/3duty 4com  
/*
1000 010abXcX 
c=0:1/2 偏置
c=1:1/3 偏置
ab=00:2 COMS
ab=01:3 COMS
ab=10:4 COMS
*/
// #define  SYSDIS   0X00             //0b1000 0000 0000  关振系统荡器和LCD偏压发生器
// #define  SYSEN    0X02             //0b1000 0000 0010 打开系统振荡器
// #define  LCDOFF   0X04             //0b1000 0000 0100  关LCD偏压
// #define  LCDON    0X06             //0b1000 0000 0110  打开LCD偏压
// #define  XTAL     0x28             //0b1000 0010 1000 外部接时钟
// #define  RC256    0X30             //0b1000 0011 0000  内部时钟
// #define  TONEON   0X12             //0b1000 0001 0010  打开声音输出
// #define  TONEOFF  0X10             //0b1000 0001 0000 关闭声音输出
// #define  WDTDIS1  0X0A             //0b1000 0000 1010  禁止看门狗

void HT1621::wrCLR(unsigned char len) {
	unsigned char addr = 0;
	unsigned char i;
	for (i = 0; i < len; i++) {
		wrclrdata(addr, 0x00);
		addr = addr + 2;
	}
}

void HT1621::setBatteryLevel(int level,unsigned char *s) {
	// zero out the previous (otherwise the or couldn't be possible)
	// _buffer[0] &= 0x7F;
	// _buffer[1] &= 0x7F;
	// _buffer[2] &= 0x7F;
	unsigned char i;
	for(i=0;i<6;i++)
	{
		_buffer[i] &= 0x00;
	}



	switch(level){
		case 3: // battery on and all 3 segments
			// _buffer[0] |= 0x80;
			// _buffer[0] |= 0xFE;
			_buffer[0] |= LCDCODE[s[0]];
			_buffer[1] |= LCDCODE[s[1]];
			_buffer[2] |= LCDCODE[s[2]];
			_buffer[3] |= LCDCODE[s[3]];
			_buffer[4] |= LCDCODE[s[4]];
			// _buffer[5] |= 0xFE;
			// _buffer[6] |= 0xEF;




			
		case 2: // battery on and 2 segments
			// _buffer[1] |= 0x80;
		case 1: // battery on and 1 segment
			// _buffer[2] |= 0x80;
		case 0: // battery indication off
		default:
			break;
	}

	update();
}

void HT1621::clear(){
	wrCLR(16);
	// wrCLR(31);
}

// takes the buffer and puts it straight into the driver
void HT1621::update(){
	// the buffer is backwards with respect to the lcd. could be improved
	// wrone(0, _buffer[5]);
	wrone(0, _buffer[0]);
	wrone(2, _buffer[1]);
	wrone(4, _buffer[2]);
	wrone(6, _buffer[3]);
	wrone(8, _buffer[4]);
	// wrone(10, _buffer[5]);
	// wrone(12, _buffer[6]);

	
	// wrone(0, _buffer[5]);
	// wrone(2, _buffer[4]);
	// wrone(4, _buffer[3]);
	// wrone(6, _buffer[2]);
	// wrone(8, _buffer[1]);
	// wrone(10,_buffer[0]);
}

void HT1621::print(long num, const char* flags, int precision){
	if(num > 999999) // basic checks
		num = 999999; // clip into 999999
	if(num < -99999) // basic checks
		num = -99999; // clip into -99999

	char localbuffer[7]; //buffer to work within the function
	snprintf(localbuffer, 7, flags, num); // convert the decimal into string
	#ifdef _HTDEBUG
		Serial.begin(9600);
		Serial.print(localbuffer);
		Serial.print("\t");
	#endif

	// horrible handling but should get us working. needs refactor in next major
	if (precision > 0 && (num) < pow(10, precision)) {
		// we remove extra leading zeros
		for (int i = 0; i < (5 - precision); i++) {
			#ifdef _HTDEBUG
				Serial.print(localbuffer[1]);
			#endif // _HTDEBUG
			if(localbuffer[i+1] == '0' && localbuffer[i] != '-'){ // we remove only if there is another zero ahead AND if it's not a minus sign
				localbuffer[i] = ' ';
			}
			else{
				break;
			} 
			#ifdef _HTDEBUG
				Serial.println();buffer[1]);
			#endif // _HTDEBUG
	}
	}


	for(int i=0; i<6; i++){
		_buffer[i] &= 0x80; // mask the first bit, used by batter and decimal point
		_buffer[i] |= charToSegBits(localbuffer[i]);
	}
	update();
}

void HT1621::print(double num, int precision){
	if(num > 999999) // basic checks
		num = 999999; // clip into 999999
	if(num < -99999) // basic checks
		num = -99999; // clip into -99999

	if(precision > 3 && num > 0)
		precision = 3; // if positive max precision allowed = 3
	else if(precision > 2 && num < 0)
		precision = 2;// if negative max precision allowed = 2
	if(precision < 0)
		precision = 0; // negative precision?!

	const char* flags = (precision > 0 && abs(num) < 1) ? "%06li" : "%6li";

	long integerpart;
	integerpart = ((long)(num*pow(10,precision)));

	print(integerpart, flags, precision); // draw the integerized number
	setdecimalseparator(precision); // draw the decimal point

	update();
}


void HT1621::printCelsius(double num){
	if(num > 9999) // basic checks
		num = 9999; // clip into 999999
	if(num < -999) // basic checks
		num = -999; // clip into -99999

	int precision;
	
	if(num <= -100 || num >= 999)
		precision = 0;	// if negative max precision allowed = 0
	else 
		precision = 1;	// if positive max precision allowed = 1

	const char* flags = (precision > 0 && abs(num) < 1) ? "%04li*C" : "%4li*C";

	long integerpart;
	integerpart = ((long)(num*pow(10,precision)));


	print(integerpart, flags, precision); // draw the integerized number
	if(precision > 0)
		setdecimalseparator(precision+2); // draw the decimal point shifted by 2
	else 	
		setdecimalseparator(0); // or clear the decimal separator

	update();
}

void HT1621::print(const char* str, bool leftPadded){
	int chars = strlen(str);
	int padding = 6 - chars;

	for(int i = 0; i < 6; i++){
		_buffer[i] &= 0x80; // mask the first bit, used by batter and decimal point
		char character = leftPadded
				 		 ? i < padding ? ' ' : str[i - padding]
				 		 : i >= chars ? ' ' : str[i];
		_buffer[i] |= charToSegBits(character);
	}

	setdecimalseparator(0); // Hide decimal point
	update();
}

void HT1621::setdecimalseparator(int decimaldigits) {
	// zero out the eight bit
	_buffer[3] &= 0x7F;
	_buffer[4] &= 0x7F;
	_buffer[5] &= 0x7F;

	if( decimaldigits <= 0 || decimaldigits > 3){
		return;
	}

	// 3 is the digit offset
	// the first three eights bits in the buffer are for the battery signs
	// the last three are for the decimal point
	_buffer[6-decimaldigits] |= 0x80;
}

char HT1621::charToSegBits(char character) {
	switch (character) {
	case '*': // For degree for now
		return 0b0110011;
	case '|':
		return 0b0000101;
	case '-':
		return 0b0000010;
	case '_':
		return 0b0001000;
	case '0':
		return 0b1111101;
	case '1':
		return 0b1100000;
	case '2':
		return 0b111110;
	case '3':
		return 0b1111010;
	case '4':
		return 0b1100011;
	case '5':
		return 0b1011011;
	case '6':
		return 0b1011111;
	case '7':
		return 0b1110000;
	case '8':
		return 0b1111111;
	case '9':
		return 0b1111011;
	case 'A':
	case 'a':
		return 0b1110111;
	case 'b':
	case 'B':
		return 0b1001111;
	case 'c':
	//	return 0b0001110;
	case 'C':
		return 0b0011101;
	case 'd':
	case 'D':
		return 0b1101110;
	case 'e':
	//	return 0b0001110;
	case 'E':
		return 0b0011111;
	case 'f':
	//	return 0b0000111;
	case 'F':
		return 0b0010111;
	case 'G':
	case 'g':
		return 0b1011101;
	case 'h':
	//	return 0b1000111;
	case 'H':
		return 0b1100111;
	case 'i':
	//	return 0b1000000;
	case 'I':
		return 0b1100000;
	case 'J':
	case 'j':
		return 0b1101000;
	case 'l':
	//	return 0b1100000;
	case 'L':
		return 0b0001101;
	case 'm':
	case 'M':
		return 0b1010100;
	case 'n':
	case 'N':
		return 0b1000110;
	case 'O': // we can keep this for zero
	//	return 0b1111101;
	case 'o':
		return 0b1001110;
	case 'P':
	case 'p':
		return 0b0110111;
	case 'q':
	case 'Q':
		return 0b1110011;
	case 'r':
	case 'R':
		return 0b0000110;
	case 'S':
	case 's':
		return 0b1011011;
	case 't':
	case 'T':
		return 0b0001111;
	case 'u':
	//	return 0b1001100;
	case 'U':
		return 0b1101101;
	case 'Y':
	case 'y':
		return 0b1101011;
	case 'z':
	case 'Z':
		return 0b0111110;
	case ' ':
	default:
		return 0b0000000;
	}
}

Battery_levels.ino

/*
  Battery Levels

  Displays the various battery levels with 500ms
  pause between.

  The circuit:
  cs to pin 13
  wr to pin 12
  Data to pin 8
  backlight to pin 10

  Created 9 dec 2018
  By valerio\new (5N44P)

  https://github.com/valerionew/ht1621-7-seg

*/

#include <HT1621.h> // include our library


HT1621 lcd; // create an "lcd" object

unsigned char LCD_tmp[5];

void setup(){
  // start the lcd:
  // cs to pin 13
  // wr to pin 12
  // Data to pin 8
  // backlight to pin 10
  // you can chose whichever pin you want


  lcd.begin(13, 12, 8, 10); // (cs, wr, Data, backlight)
  // if no backlight control is given, you can also use:
  // lcd.begin(13, 12, 8); // (cs, wr, Data)

  lcd.backlight(); // turn on the backlight led

  lcd.clear(); // clear the screen
}

void loop(){
  static unsigned int num = 0;
  num++;

  LCD_tmp[0] = num/10000%10; // 万位:第1位显示的内容(左->右)
  LCD_tmp[1] = num/1000%10;       // 千位
  LCD_tmp[2] = num/100%10;       // 百位
  LCD_tmp[3] = num/10%10; // 十位
  LCD_tmp[4] = num%10; // 个位
  if(num >= 100000){num = 0;}
    //设置四前面千/百/十位不要显示0
    if(LCD_tmp[0] <= 0 && num < 10000){LCD_tmp[0]=10;} 
    if(LCD_tmp[1] <= 0 && num < 1000){LCD_tmp[1]=10;} // CODE[10] 是 0X00 不显示
    if(LCD_tmp[2] <= 0 && num < 100){LCD_tmp[2]=10;}
    if(LCD_tmp[3] <= 0 && num < 10){LCD_tmp[3]=10;}
  
  lcd.setBatteryLevel(3,LCD_tmp);
  delay(100);

  
  lcd.setBatteryLevel(2);
//  delay(500);
//  lcd.setBatteryLevel(3);
//  delay(500);
}

成果展示

“Arduino UNO TH1621 LCD成果展示”



资料下载

  • 【CSDN】汇总:TH1621 LCD开发资料(20240406)

参考资料

  • [1] 【Github】ht1621-7-seg (forked from anxzhu/segment-lcd-with-ht1621)
  • [2] 【CSDN@weiDev101】LCD Glass段码屏的驱动
  • [3] 【CSDN】STM32F103学习笔记(4)——LCD段码屏HT1621使用

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

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

相关文章

算法学习 | day40/60 单词拆分/多重背包/背包问题总结

一、题目打卡 1.1 单词拆分 题目链接&#xff1a;. - 力扣&#xff08;LeetCode&#xff09; class Solution { public:bool findInVector(vector<string> &w, string& s){for(auto & it : w){if(it s) return true;}return false;}bool wordBreak(string …

第三十八节 Java 多线程编程

Java 给多线程编程提供了内置的支持。一个多线程程序包含两个或多个能并发运行的部分。程序的每一部分都称作一个线程&#xff0c;并且每个线程定义了一个独立的执行路径。 多线程是多任务的一种特别的形式。多线程比多任务需要更小的开销。 这里定义和线程相关的另一个术语&…

第三十七节 Java 发送邮件

Java 发送邮件 使用Java应用程序发送E-mail十分简单&#xff0c;但是首先你应该在你的机器上安装JavaMail API 和Java Activation Framework (JAF) 。 你可以在 JavaMail (Version 1.2) 下载最新的版本。 你可以再 在JAF (Version 1.1.1)下载最新的版本。 下载并解压这些文…

云HIS系统操作指南

医疗(医院&#xff09;机构正式使用云HIS系统之前&#xff0c;要先进行院内基础数据的配置&#xff0c; 主要在数据管理模块中进行&#xff0c;由系统管理员来操作。 机构信息&#xff1a;主要是记录医院的基本信息和机构信息。 科室管理&#xff1a;是用来管理医疗&#xff08…

基于SSM的校园生活管理系统设计与实现(内附设计LW + PPT+ 源码下载)

摘 要 随着现代化发展进程不断的加快&#xff0c;人们对于网络的接受程度越来越强&#xff0c;现在人们的生活与工作已经离不开网络的帮助。而网络在当下的学校中也已经非常的普及&#xff0c;现在各类学校的网络覆盖率已经接近于100%。基于互联网来实现对学校校内的教育、教…

c# wpf datagrid 简单试验

1.概要 datagrid 一个列表类的控件 2.代码 <Window x:Class"WpfApp2.Window3"xmlns"http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x"http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d"http://schemas.mic…

Mac电脑安装蚁剑

1&#xff1a; github 下载源码和加载器&#xff1a;https://github.com/AntSwordProjectAntSwordProject GitHubAntSwordProject has 12 repositories available. Follow their code on GitHub.https://github.com/AntSwordProject 以该图为主页面&#xff1a;antSword为源码…

go语言学习--3.常用语句

目录 1.条件语句 1.1 if语句 1.2 if-else语句 1.3 switch语句 1.4 select语句 2.循环语句 2.1循环处理语句 2.2循环控制语句 3.go语言关键字 1.条件语句 和c语言类似&#xff0c;相关的条件语句如下表所示&#xff1a; 1.1 if语句 if 布尔表达式 {/* 在布尔表达式为 t…

软考 — 系统架构设计师 - 嵌入式真题

问题1&#xff1a; 可靠度表示系统在规定条件下&#xff0c;规定的时间内不发生失效的概率。 失效率表示系统运行到此时从未出现失效的情况下&#xff0c;单位时间内系统出现失效的概率 问题 2&#xff1a; 动态冗余又称为主动冗余&#xff0c;通过故障检测&#xff0c;故障定…

[大模型]Qwen1.5-4B-Chat WebDemo 部署

Qwen1.5-4B-Chat WebDemo 部署 Qwen1.5 介绍 Qwen1.5 是 Qwen2 的测试版&#xff0c;Qwen1.5 是基于 transformer 的 decoder-only 语言模型&#xff0c;已在大量数据上进行了预训练。与之前发布的 Qwen 相比&#xff0c;Qwen1.5 的改进包括 6 种模型大小&#xff0c;包括 0.…

【服务器部署篇】Linux下JDK的安装和配置

作者介绍&#xff1a;本人笔名姑苏老陈&#xff0c;从事JAVA开发工作十多年了&#xff0c;带过刚毕业的实习生&#xff0c;也带过技术团队。最近有个朋友的表弟&#xff0c;马上要大学毕业了&#xff0c;想从事JAVA开发工作&#xff0c;但不知道从何处入手。于是&#xff0c;产…

TR4 - Transformer中的多头注意力机制

目录 前言自注意力机制Self-Attention层的具体机制Self-Attention 矩阵计算 多头注意力机制例子解析 代码实现总结与心得体会 前言 多头注意力机制可以说是Transformer中最主要的模块&#xff0c;没有之一。这次我们来仔细分析一下注意力机制与多头注意力机制。 自注意力机制…

KubeSphere 社区双周报|2024.03.29-04.11

KubeSphere 社区双周报主要整理展示新增的贡献者名单和证书、新增的讲师证书以及两周内提交过 commit 的贡献者&#xff0c;并对近期重要的 PR 进行解析&#xff0c;同时还包含了线上/线下活动和布道推广等一系列社区动态。 本次双周报涵盖时间为&#xff1a;2024.03.29-04.11…

如何在Pycharm中快捷放大和缩小代码界面?

如何在Pycharm中快捷放大和缩小代码界面&#xff1f; 【File】->【Setting】->【keymap】 在Keymap中找到Increase Font Size&#xff0c;双击&#xff0c;选择Add Mouse Shortcut 在弹出的Mouse Shortcut界面&#xff0c;按住 Ctrl 并同时向上滚动鼠标滚轮&#xff0c;…

基于LNMP部署wordpress

目录 一.环境准备 二.配置源并安装 三.配置Nginx 四.配置数据库 五.上传源码并替换 六.打开浏览器&#xff0c;输入虚拟机ip访问安装部署 七.扩展增加主题 一.环境准备 centos7虚拟机 关闭防火墙和seliunx stop firewalld #关闭防火墙 setenforce 0 …

golang 冒泡、选择、插入、快速排序法

个人学习笔记&#xff5e; 1. 冒泡排序 // Author sunwenbo // 2024/4/6 22:37 /* 1. 一共会经过arr.length -1 次的轮数比较&#xff0c;每一轮将会确认一个数的位置 2. 每一轮的比较次数逐渐的减少 [4,3,2,1] 3. 当发现前面的一个数比后面的一个数大的时候&#xff0c;就进行…

kubectl_入门_Pod配置以及生命周期

Pod配置以及生命周期 1. Pod结构定义 每个pod中都可以包含一个或多个容器&#xff0c;这些容器可以分为两类 用户程序所在的容器&#xff0c;数量可多可少Pause容器&#xff0c;这是每个Pod都会有的一个根容器&#xff0c;它的作用有两个 可以以它为根据&#xff0c;评估整个…

参与 PenPad Season 2 获得勋章,还有海量 Scroll 生态稀缺权益

PenPad是Scroll生态中的首个LaunchPad平台&#xff0c;该平台继承了Scroll生态的技术优势&#xff0c;具备包括隐私在内的系列特点&#xff0c;同时且也被认为是Scroll生态最重要的价值入口之一。Penpad与Scroll官方始终保持着合作&#xff0c;同时该项目自启动以来长期得到Scr…

宁盾radius认证服务器软件如何实现802.1X认证/Portal认证上网(portal web入网认证)

一、什么是802.1X认证和Portal认证以及有什么区别 随着企业网络规模的不断扩大和网络安全威胁的日益加剧&#xff0c;有效的网络认证机制成为保障网络安全的关键。其中&#xff0c;802.1X认证和Portal认证是两种常见的网络认证方式&#xff0c;它们各有特点&#xff0c;适用于…

MySQL高可用搭建方案MHA

MHA架构介绍 MHA是Master High Availability的缩写&#xff0c;它是目前MySQL高可用方面的一个相对成熟的解决方案&#xff0c;其核心是使用perl语言编写的一组脚本&#xff0c;是一套优秀的作为MySQL高可用性环境下故障切换和主从提升的高可用软件。在MySQL故障切换过程中&am…