蓝桥杯单片机-国赛7——第十四届主观题代码参考

0.编程心得

本题中,要求测距能达到250cm,因此pca必须配置为0x01,但直接用会死机,因此需要使用CH作为判断量。

【iic的at24c02记录】:
读设备地址:0xA1    写设备地址:0xA0
非应答信号:sda先1,后还是1。本届直接实参传1就是非应答
02表示2k大小
时序操作可完全参考手册

【onewire的ds18b20】:
MSB | LSB 的高5位全0,则读取温度为正数。全1则读取温度为负数    精度为0.0625
时序要自己背:初始化、写入0xcc、写入0x44、延时800ms、初始化、写入0xcc、写入0xbe、读取数据

        LSB = Read_DS18B20();    先读出来的是低八位
        MSB = Read_DS18B20();
    temperature = MSB;
    temperature = ( temperature << 8 ) | LSB;
    temperature = (temperature >> 4)*10 + (LSB & 0x0f)*0.625;
刷新时间:2s刷新一次!!!!
数据如果闪烁,就在底层代码的读取函数中,在DQ电平变高后加一个5us

【led的刷新】:
刷新可以和数码管一起,40个50us刷新一次,2ms
涉及锁存器5的所有操作,都不要放while循环里。而且设置形参,直接调用

【iic的pcf8591记录】:

读设备地址:0x91    写设备地址:0x90
控制字:0 D/A-flag x x     0 x A/Dchannal
channal:00  外部模拟信号控制端
    01  光敏电阻rd1        0x01
    10  差分放大电路信号
    11  滑动变阻器rb2        0x03
void dacrunning ( unsigned char value_dac )    //DAC输出,不能设置刷新位,要一直输出
{
        I2CStart();
        I2CSendByte( 0x90 );
        I2CWaitAck();
        I2CSendByte( 0x43 );
        I2CWaitAck();
        I2CSendByte( value_dac );
        I2CWaitAck();
        I2CStop();
}
输出DAC:0x43

1.比赛真题

2.特殊模块

字节反序程序

超声波程序

双按键程序

双按键下的delay函数要长一些,不然容易误判,因此人不可能做到100%同时按下

3.参考代码

main.c

#include <REGX52.H>
#include <intrins.h>
#include "iic.h"
#include "onewire.h"sfr AUXR = 0x8e;
sfr P4 = 0xc0;
sfr CCON        =   0xD8;   //00xx,xx00 PCA控制寄存器
sbit CF         =   CCON^7;
sbit CR         =   CCON^6;
sfr CMOD        =   0xD9;   //0xxx,x000 PCA 工作模式寄存器
sfr CL          =   0xE9;   //0000,0000 PCA计数器低字节
sfr CH          =   0xF9;   //0000,0000 PCA计数器高字节sbit TX = P1^0;
sbit RX = P1^1;sbit C1 = P4^4;
sbit C2 = P4^2;
sbit R3 = P3^2;
sbit R4 = P3^3;unsigned char param_mode = 1;
unsigned char SMG_mode = 1;
unsigned char param_distance = 40;
unsigned char param_temperature = 30;
unsigned char param_dac = 10;
unsigned int param_V = 340;
unsigned char save_distance = 0;
unsigned char value_led = 0xff;
float value_sonic = 0.0;
int param_calibration = 0;
bit flag_reset = 0;
bit flag_dac = 0;
bit flag_m_distance = 0;
bit flag_save_distance = 0;unsigned char code duanma[18] = {0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x83,0xc6,0xc0,0x86,0x8e,0xbf,0x8c};
unsigned char code duanma_dot[10] = {0x40,0x79,0x24,0x30,0x19,0x12,0x02,0x78,0x00,0x10};void scan_key ();
void value_work ();unsigned char reverse_bit ( unsigned char dat )
{dat = (dat & 0xF0) >> 4 | (dat & 0x0F) << 4;dat = (dat & 0xCC) >> 2 | (dat & 0x33) << 2;dat = (dat & 0xAA) >> 1 | (dat & 0x55) << 1;return dat;
}void select_HC573 ( unsigned char channal , unsigned char dat )
{P2 = (P2&0x1f)|0x00;P0 = dat;switch ( channal ){case 4:P2 = (P2&0x1f)|0x80;break;case 5:P2 = (P2&0x1f)|0xa0;break;case 6:P2 = (P2&0x1f)|0xc0;break;case 7:P2 = (P2&0x1f)|0xe0;break;}P2 = (P2&0x1f)|0x00;
}void state_SMG ( unsigned char pos_SMG , unsigned char value_SMG )
{select_HC573 ( 6 , 0x01<<pos_SMG );select_HC573 ( 7 , value_SMG );
}void state_SMG_all ( unsigned char value_SMG )
{select_HC573 ( 6 , 0xff );select_HC573 ( 7 , value_SMG );
}void init_pca () 
{CMOD = 0x01;CCON = 0x00;
}void Delay13us()		//@12.000MHz
{unsigned char i;_nop_();_nop_();i = 38;while (--i);
}bit flash_sonic = 0;
unsigned int dis_distance = 0;
void send_sonic ()
{unsigned char i;for ( i=0 ; i<8 ; i++ ){TX = 1;Delay13us();TX = 0;Delay13us();}
}void recive_sonic ()
{if ( flash_sonic == 1 ){unsigned int tmp = 0;CL = CH = CF = 0;EA = 0;send_sonic ();EA = 1;CR = 1;while ( RX==1 && CH < 0x40 );CR = 0;if ( CH > 0x40 ){CF = 0;tmp = 999;}else{tmp = CH;tmp = (tmp<<8)|CL;tmp = (unsigned int)(tmp*value_sonic+param_calibration);					}dis_distance = tmp;flash_sonic = 0;if ( flag_save_distance == 1 )save_distance = tmp;}
}void Delay800ms()		//@12.000MHz
{unsigned char i, j, k;_nop_();_nop_();i = 37;j = 123;k = 92;do{do{value_work();scan_key ();while (--k);} while (--j);} while (--i);
}bit flash_ds18b20 = 0;
unsigned int dis_temperature = 0;
void recive_ds18b20 ( )
{if ( flash_ds18b20 == 1 ){unsigned int tmp = 0;unsigned char MSB,LSB;init_ds18b20();Write_DS18B20(0xcc);Write_DS18B20(0x44);		Delay800ms();init_ds18b20();Write_DS18B20(0xcc);Write_DS18B20(0xbe);LSB = Read_DS18B20();MSB = Read_DS18B20();tmp = MSB;tmp = (tmp<<8)|LSB;
//		tmp = (tmp>>4)*10+(LSB&0x0f)*0.625;tmp = (unsigned int)tmp*0.625;dis_temperature = tmp;flash_ds18b20 = 0;}
}unsigned char dac_value = 0;
void dac_work ( unsigned char dac_value )
{I2CStart();I2CSendByte(0x90);I2CWaitAck();I2CSendByte(0x43);I2CWaitAck();I2CSendByte(dac_value);I2CWaitAck();I2CStop();
}unsigned char flash_count = 0;
void flash_SMG ()
{state_SMG_all ( 0xff );if ( SMG_mode == 1 ){switch ( flash_count ){case 0:state_SMG ( 0 , duanma[dis_temperature/100] );break;case 1:state_SMG ( 1 , duanma_dot[dis_temperature/10%10] );break;case 2:state_SMG ( 2 , duanma[dis_temperature%10] );break;case 3:state_SMG ( 3 , duanma[16] );break;case 4:if ( dis_distance > 999 )state_SMG ( 4 , duanma[dis_distance/1000] );elsestate_SMG ( 4 , 0xff );break;case 5:if ( dis_distance > 99 && flag_m_distance == 0 )state_SMG ( 5 , duanma[dis_distance/100%10] );else if ( flag_m_distance == 1 )state_SMG ( 5 , duanma_dot[dis_distance/100%10] );elsestate_SMG ( 5 , 0xff );break;case 6:if ( dis_distance > 9 && flag_m_distance == 0 )state_SMG ( 6 , duanma[dis_distance/10%10] );else if ( flag_m_distance == 1 )state_SMG ( 6 , duanma[dis_distance/10%10] );elsestate_SMG ( 6 , 0xff );break;case 7:state_SMG ( 7 , duanma[dis_distance%10] );break;}}else if ( SMG_mode == 2 ){switch ( flash_count ){case 0:state_SMG ( 0 , duanma[17] );break;case 1:state_SMG ( 1 , duanma[param_mode] );break;case 2:if ( param_mode == 1 )state_SMG ( 6 , duanma[param_distance/10] );elsestate_SMG ( 6 , duanma[param_temperature/10] );break;case 3:if ( param_mode == 1 )state_SMG ( 7 , duanma[param_distance%10] );elsestate_SMG ( 7 , duanma[param_temperature%10] );break;}}else if ( SMG_mode == 3 ){switch ( flash_count ){case 0:state_SMG ( 0 , duanma[15] );break;case 1:state_SMG ( 1 , duanma[1] );break;case 2:if ( param_calibration > 99 )state_SMG ( 5 , duanma[param_calibration/100] );else if ( param_calibration < -9 )state_SMG ( 5 , duanma[16] );elsestate_SMG ( 5 , 0xff );break;		case 3:if ( param_calibration > 9 )state_SMG ( 6 , duanma[param_calibration/10%10] );else if ( param_calibration < 0 && param_calibration > -9 )state_SMG ( 6 , duanma[16] );else if ( param_calibration < 9 && param_calibration != 0 )state_SMG ( 6 , duanma[(-1)*param_calibration/10%10] );elsestate_SMG ( 6 , 0xff );break;	case 4:if ( param_calibration > 0)state_SMG ( 7 , duanma[param_calibration%10] );elsestate_SMG ( 7 , duanma[(-1*param_calibration)%10] );break;	}		}	else if ( SMG_mode == 4 ){switch ( flash_count ){case 0:state_SMG ( 0 , duanma[15] );break;case 1:state_SMG ( 1 , duanma[2] );break;case 2:if ( param_V > 999 )state_SMG ( 4 , duanma[param_V/1000] );elsestate_SMG ( 4 , 0xff );break;case 3:if ( param_V > 99 )state_SMG ( 5 , duanma[param_V/100%10] );elsestate_SMG ( 5 , 0xff );break;case 4:if ( param_V > 9 )state_SMG ( 6 , duanma[param_V/10%10] );elsestate_SMG ( 6 , 0xff );break;case 5:state_SMG ( 7 , duanma[param_V%10] );break;	}}	else if ( SMG_mode == 5 ){switch ( flash_count ){case 0:state_SMG ( 0 , duanma[15] );break;case 1:state_SMG ( 1 , duanma[3] );break;case 2:state_SMG ( 6 , duanma_dot[param_dac/10] );break;case 3:state_SMG ( 7 , duanma[param_dac%10] );break;}}
}	void reset_work ()
{SMG_mode = 1;param_distance = 40;param_temperature = 30;param_calibration = 0;param_V = 340;param_dac = 10;		
}void init_timer0(void)		//50微秒@12.000MHz
{AUXR &= 0x7F;		//定时器时钟12T模式TMOD &= 0xF0;		//设置定时器模式TMOD |= 0x02;		//设置定时器模式TL0 = 0xCE;		//设置定时初始值TH0 = 0xCE;		//设置定时重载值TF0 = 0;		//清除TF0标志TR0 = 1;		//定时器0开始计时ET0 = 1;EA = 1;
}unsigned char count_50us = 0;
unsigned char count_10ms = 0;
bit flag_100ms = 0;
unsigned char count_save_10ms = 0;
unsigned char count_save_1s = 0;
unsigned char count_reset = 0;
void timer0_service () interrupt 1
{if ( ++count_50us == 200 ){count_50us = 0;	if ( ++count_10ms == 200 )count_10ms = 0;		if ( flag_save_distance == 1 ){if ( ++count_save_10ms == 100 ){count_save_10ms = 0;if ( ++count_save_1s == 6 )flag_save_distance = 0;}}else{count_save_10ms = 0;count_save_1s = 0;}if ( flag_reset == 1 ){if ( ++count_reset == 200 )reset_work();}elsecount_reset = 0;}if ( count_50us % 40 == 0 ) //刷新数码管和led{if ( SMG_mode == 1 ){if ( ++flash_count == 8 )flash_count= 0;}else if ( SMG_mode == 4 ){if ( ++flash_count > 5 )flash_count= 0;}else if ( SMG_mode == 2 || SMG_mode == 5 ){if ( ++flash_count > 3 )flash_count= 0;}else if ( SMG_mode == 3 ){if ( ++flash_count > 4 )flash_count= 0;}flash_SMG ();select_HC573 ( 4 , value_led );}if ( count_10ms % 50 == 0 ){flash_sonic = 1;}if ( count_10ms % 100 == 0 )//让温度和超声波不同时刷新,避免数据问题{flash_ds18b20 = 1;	}	if ( SMG_mode == 1 ){if ( dis_distance > 255 )value_led = 0x00;elsevalue_led = reverse_bit( ~(dis_distance/8) );}else if ( SMG_mode == 2 )value_led = 0x7f;else if ( SMG_mode > 2 ){if ( count_10ms % 10 == 0 )value_led = 0xfe;else value_led = 0xff;}}void value_work ()
{if ( flag_dac == 1 && save_distance != 0 ){	if ( save_distance > 90 )dac_value = 255;else if ( save_distance > 10 )dac_value = (3.2-0.05*param_dac)*save_distance;elsedac_value = param_dac*5.1;flag_dac = 0;}if ( dis_distance <= param_distance+5 && dis_distance >= param_distance-5 && dis_temperature <= param_temperature*10 )select_HC573 ( 5 , 0x10 );else select_HC573 ( 5 , 0x00 );	}void Delay2ms()		//@12.000MHz
{unsigned char i, j;i = 24;j = 85;do{while (--j);} while (--i);
}void Delay30ms()		//@12.000MHz
{unsigned char i, j, k;_nop_();_nop_();i = 2;j = 95;k = 43;do{do{while (--k);} while (--j);} while (--i);
}void scan_key ()
{if ( flag_save_distance == 1 )return;C1 = 0;C2 = R3 = R4 = 1;if ( R3 == 0 ){Delay2ms();if ( R3 == 0 )	//5{//测距界面1 参数界面2 工厂模式3校准值4介质设置5dac输出if ( SMG_mode == 1 ){if ( flag_m_distance == 0 )flag_m_distance = 1;else if ( flag_m_distance == 1 )flag_m_distance = 0;}else if ( SMG_mode == 2 ){				if ( param_mode == 1 )param_mode = 2;else if ( param_mode == 2 )param_mode = 1;				}else {switch ( SMG_mode ){case 3:SMG_mode = 4;break;case 4:SMG_mode = 5;break;case 5:SMG_mode = 3;break;}}			while ( R3 == 0 );}}else if ( R4 == 0 ){Delay2ms();if ( R4 == 0 )	//4{	switch ( SMG_mode ){//测距界面1 参数界面2 工厂模式3校准值4介质设置5dac输出case 1:SMG_mode = 2;param_mode = 1;break;case 2:SMG_mode = 3;break;case 3:case 4:case 5:SMG_mode = 1;break;}				while ( R4 == 0 );}}C2 = 0;C1 = R3 = R4 = 1;if ( R3 == 0 || R4 == 0 ){Delay30ms();if ( R3 == 0 && R4 == 0 ){flag_reset = 1;	while ( R3 == 0 && R4 == 0 ){flag_reset = 1;	}flag_reset = 0;	}else if ( R3 == 0 )	//9{//测距界面1 参数界面2 工厂模式3校准值4介质设置5dac输出if ( SMG_mode == 2 && param_mode == 1 )param_distance -= 10;else if ( SMG_mode == 2 && param_mode == 2 )param_temperature -= 10;else if ( SMG_mode == 3 )param_calibration -= 5;else if ( SMG_mode == 4 ){param_V -= 10;value_sonic = (float)param_V/2/100;}else if ( SMG_mode == 5 )param_dac -=1;else if ( SMG_mode == 1 )flag_dac = 1;			if ( param_distance < 10 )param_distance = 10;else if ( param_temperature > 100 ) //越位了会变成255param_temperature = 0;else if ( param_calibration < -90 )param_calibration = -90;else if ( param_V < 10 )param_V = 10;else if ( param_dac < 1 )param_dac = 1;value_sonic = (float)(param_V)*0.00005;while ( R3 == 0 );}else if ( R4 == 0 )	//8{//测距界面1 参数界面2 工厂模式3校准值4介质设置5dac输出if ( SMG_mode == 2 && param_mode == 1 )param_distance += 10;else if ( SMG_mode == 2 && param_mode == 2 )param_temperature += 10;else if ( SMG_mode == 3 )param_calibration += 5;else if ( SMG_mode == 4 ){param_V += 10;value_sonic = (float)param_V*0.00005;}else if ( SMG_mode == 5 )param_dac +=1;else if ( SMG_mode == 1 )flag_save_distance = 1;		if ( param_distance > 90 )param_distance = 90;else if ( param_temperature > 80 ) //越位了会变成255param_temperature = 80;else if ( param_calibration > 90 )param_calibration = 90;else if ( param_V > 9990 )param_V = 9990;else if ( param_dac > 20 )param_dac = 20;			value_sonic = (float)(param_V)*0.00005;while ( R4 == 0 );}}
}void init_sys ()
{select_HC573 ( 4 , 0xff );select_HC573 ( 5 , 0x00 );value_sonic = (float)(param_V)*0.00005;
}void main ()
{init_sys ();init_timer0 ();init_pca ();while ( 1 ){scan_key ();value_work();recive_sonic ();recive_ds18b20 ();dac_work ( dac_value );	}
}

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

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

相关文章

【Linux】Linux基本指令3

目录 1.date指令 2.cal指令 3.find指令&#xff1a;&#xff08;灰常重要&#xff09; -name 4.grep指令——行文本过滤工具 5.zip/unzip指令&#xff1a; 6.tar指令&#xff08;重要&#xff09;&#xff1a;打包/解包&#xff0c;不打开它&#xff0c;直接看内容 7.bc…

Dinky DorisCDC 整库同步到 Doris

doris flinkcdc语法参考 Flink Doris Connector - Apache Doris 参考&#xff1a; Doris Flink DolphinScheduler Dinky 构建开源数据平台_dinky dolphinscheduler flink-CSDN博客

2024年,抖音小店618十大爆款预测!商家抓紧时间上架!

哈喽~我是电商月月 做电商的玩家都知道&#xff0c;一但到了换季或者是节日大促的时候&#xff0c;销量高&#xff0c;是最容易爆单的阶段 而提前上架一些热卖产品&#xff0c;爆单的几率在自己的店铺机会就越大 而最近的一个大型活动&#xff0c;就是618了&#xff0c;抖音…

只出现一次的数字II ---- 位运算

题目链接 题目: 分析: 对于只出现一次的数字, 他的任意一个bit位, 可能是0或1对于其余出现3次的数字, 假设有3n个数, 那么他们的任意一个bit相加的和可能是3n个0或3n个1那么对于数组中的全部数字的任意一个bit位之和共有三种情况: 3n个1 1 3n13n个0 1 13n个1 0 3n3n个0…

华为认证学习笔记:生成树

以太网交换网络中为了进行链路备份&#xff0c;提高网络可靠性&#xff0c;通常会使用冗余链路。但是使用冗余链路会在交换网络上产生环路&#xff0c;引发广播风暴以及MAC地址表不稳定等故障现象&#xff0c;从而导致用户通信质量较差&#xff0c;甚至通信中断。为解决交换网络…

如何限制上网行为?上网行为管控软件有什么功能?

上网行为的管理与限制对于保障企业安全、提高员工工作效率以及保护孩子健康成长都显得尤为重要。 上网行为管控软件作为一种专业的工具&#xff0c;在这方面发挥着不可替代的作用。 本文将探讨如何限制上网行为&#xff0c;并介绍上网行为管控软件的主要功能。 一、如何限制上…

C++入门——类和对象【3】(6)

前言 本节是C类和对象中的最后一节&#xff0c;学完本节内容并且能够掌握之前所学的所有内容的话&#xff0c;C就可以说是入门了&#xff0c;那我们废话不多说&#xff0c;正式进入今天的学习 1. 再谈构造函数 1.1 引入 我们在栈的背景下来看 栈的代码&#xff1a; ​type…

【技术实操】银河高级服务器操作系统实例分享,达梦数据库服务器 oom 问题分析

1. 服务器环境以及配置 【 机型】 处理器&#xff1a; HUAWEIKunpeng 920 5220 内存&#xff1a; 400518528 kB 主板型号&#xff1a; Chaoqiang K620 series 整机类型/架构&#xff1a; ARM BIOS 版本&#xff1a; KL4.41.028.TF.220224.R 固件版本&#xff1a; KL4.41…

AI能否代替ACE

什么是ACE ? 申请ACE需要以下条件: 1.发表与oracle相关的技术博客 2.参与Oracle相关的技术大会 3.对Oracle社区做出贡献。 这正好是AI应用的场景吗? 在一个群里有个群友质疑AI落地,以及应用领域? Kelvin:我一直在迷茫&#xff0c;学不好。这么多有趣AI 问题&…

Redis-Cluster模式基操篇

一、场景 1、搞一套6个主节点的Cluster集群 2、模拟数据正常读写 3、模拟单点故障 4、在不停服务的情况下将集群架构改为3主3从 二、环境规划 6台独立的服务器&#xff0c;端口18001~18006 192.169.14.121 192.169.14.122 192.169.14.123 192.169.14.124 192.169.14.125 192…

迁移ISE ChipScope逻辑分析器到Vivado硬件管理器

迁移ISE ChipScope逻辑分析器到Vivado硬件管理器 介绍 本章介绍AMD Vivado™Design Suite硬件管理器&#xff0c;以及这些工具之间的关系 到ISE™设计套件ChipScope™逻辑分析器工具&#xff0c;以及如何迁移IP核 从ISE ChipScope环境到Vivado Design Suite。 Vivado硬件管理器…

使用LLaMA-Factory微调大模型

使用LLaMA-Factory微调大模型 github 地址 https://github.com/hiyouga/LLaMA-Factory 搭建环境 git clone --depth 1 https://github.com/hiyouga/LLaMA-Factory.git cd LLaMA-Factory在 LLaMA-Factory 路径下 创建虚拟环境 conda create -p ./venv python3.10激活环境 c…

为参数设置默认值

自学python如何成为大佬(目录):https://blog.csdn.net/weixin_67859959/article/details/139049996?spm1001.2014.3001.5501 调用函数时&#xff0c;如果没有指定某个参数将抛出异常&#xff0c;为了解决这个问题&#xff0c;我们可以为参数设置默认值&#xff0c;即在定义函…

Oracle Linux上安装ORDS

ORDS就是Oracle REST Data Services。 环境如下&#xff1a; Oracle Linux 8Oracle Database 19cIP地址为A.B.C.D 要安装最新版本的ORDS&#xff0c;当前为24.1.1。 全程参考文档&#xff1a;Installing and Configuring Oracle REST Data Services 安装ORDS 添加reposit…

ReDos攻击浅析

DOS为拒绝服务攻击&#xff0c;re则是由于正则表达式使用不当&#xff0c;陷入正则引擎的回溯陷阱导致服务崩溃&#xff0c;大量消耗后台性能 正则 ​ 探讨redos攻击之前&#xff0c;首先了解下正则的一些知识 执行过程 大体的执行过程分为: 编译 -> 执行编译过程中&…

数据标准的制定落地

目录 什么是数据标准 基本定义 目的 数据标准体系分类 从内容层面分类 从管理视角分类 从面向的对象分类 从数据结构的角度分类 数据标准价值 业务价值 技术价值 管理价值 数据标准和数据治理的关系 数据标准在数据治理各项任务中的作用 数据标准与主数据 数据…

实用软件分享---超级轻量级的强力卸载软件工具UninstallView_1.51

专栏介绍:本专栏主要分享一些实用的软件(Po Jie版); 声明1:软件不保证时效性;只能保证在写本文时,该软件是可用的;不保证后续时间该软件能一直正常运行;不保证没有bug;如果软件不可用了,我知道后会第一时间在题目上注明(已失效)。介意者请勿订阅。 声明2:本专栏的…

django中,出现CSRF verification failed. Request aborted.错误

这是跨站点访问的防范机制&#xff0c;csrf是一个令牌&#xff0c;会验证登录&#xff0c;需要在setting中把 "django.middleware.csrViewMiddleware" 注释掉 并在html文件中的<body>内添加 {% csrf token %} 就可以了

Star CCM+边界层设置

边界层介绍 在流体仿真中&#xff0c;边界层是指靠近实体表面的流体区域&#xff0c;其作用是描述流体在实体表面附近的速度和压力分布。边界层主要影响着物体表面的摩擦阻力、热传导以及质量传输等现象。 一般来说&#xff0c;在流体仿真中会设置一到三层不同厚度的边界层。…

最常用的电平转换电路

最常用的电平转换电路 两颗NMOS搭建的电平转换电路![请添加图片描述](https://img-blog.csdnimg.cn/direct/2b496321257f4bc4a1f23a086337ed27.png)两颗NPN三极管搭建的电平转换电路二极管钳位搭建电平转换电路二极管和MOS管组合的电平转换电路专用转换芯片电平转换 两颗NMOS搭…