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

手机端自定义做链接网站西安seo服务商

手机端自定义做链接网站,西安seo服务商,网站seo其应用,如何给客户做网站方案eg1: 单片机键盘的分类 键盘分为编码键盘和非编码键盘,键盘上闭合键的识别由专用的硬件编码器实现,并产生键编码号或键值得称为编码键盘,如计算机键盘,而靠软件来识别的称为非编码键盘,在单片机组成的各种…

eg1: 单片机键盘的分类

  • 键盘分为编码键盘和非编码键盘,键盘上闭合键的识别由专用的硬件编码器实现,并产生键编码号或键值得称为编码键盘,如计算机键盘,而靠软件来识别的称为非编码键盘,在单片机组成的各种系统中使用最多的就是非编码键盘,也有使用到编码键盘的,非编码键盘又称为独立式和矩阵式键盘。

单片机键盘根据按键的结构和工作原理的不同,可以分为以下几类:

  1. 矩阵键盘(Matrix Keyboard):
    • 矩阵键盘是最常见的单片机键盘之一。
    • 它使用一种矩阵排列的按键结构,通过行和列的交叉点来确定按下的按键。
    • 一般通过行列扫描的方式来检测按键的按下和释放。
  2. 独立按键(Individual Key):
    • 独立按键是指每一个按键都有独立的引脚连接到单片机。
    • 每个按键都使用一个独立的IO引脚,通过读取引脚的电平状态来检测按键的按下和释放。
    • 独立按键一般用于需要较少按键的应用场景。
  3. 脉冲编码开关(Encoder Switch):
    • 脉冲编码开关也被称为旋转编码开关,用于检测旋转操作。
    • 它通常由两个触点组成,通过检测两个触点的状态变化来确定旋转方向和步数。
    • 脉冲编码开关常用于旋转编码器、音量调节器等应用场景。
  4. 矩阵键盘和独立按键结合:
    • 在某些情况下,矩阵键盘和独立按键可能会结合使用。
    • 例如,一些常用的功能按键使用独立按键,而数字键盘使用矩阵键盘的方式来连接到单片机。

单片机键盘电路设计图
在这里插入图片描述test1:点击第一个按钮时点亮第一个led管

#include <REGX52.H>
#include <INTRINS.H>
sbit d1 = P1^0;
sbit keyboard01 = P3^0;void main(){P3 = 0xff; // 1111 1111while(1){if(keyboard01 == 0){d1 = 0;}else{d1 = 1;}}
}

在这里插入图片描述单片机的按键在闭合和断开时,触点会出现抖动现象
在这里插入图片描述独立键盘的检测与消抖

  • eg2: 点击独立按键的同时led亮灭同时晶体管统计次数当数字为9时归0
#include <REGX52.H>
#include <INTRINS.H>
sbit d1 = P1^0;
sbit dula = P2^6;
sbit wela = P2^7;
sbit keyboard01 = P3^0;
// 宏定义
#define uint unsigned int
#define uchar unsigned char
uchar num;
uint code table[] = {0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F,0x77,0x7C,0x39,0x5E,0x79,0x71};void delay(uint z){uint x,y;for(x = z; x > 0; x --){for(y = 110; y > 0; y--){}}}void main(){wela  = 1;P0 = 0xfe;wela = 0;P3 = 0xff; // 1111 1111while(1){if(keyboard01 == 0){delay(10);if(keyboard01 == 0){d1 = 0;num ++;if(num == 10){num = 0;}}// 判断,加上松手检测while(!keyboard01);delay(10);while(!keyboard01);}else{d1 = 1; dula = 1;P0 = table[num];dula = 0;}}
}

在这里插入图片描述eg3:矩阵键盘
在这里插入图片描述以下的矩阵表示第二行的第一个按键按下去其它的16进制依次类推
10110111 − − − − > 11101101 = = 0 x e d 10110111 ----> 1110 1101 == 0xed 10110111>11101101==0xed

在这里插入图片描述eg4:51片机矩阵代码实现每按一个按键就会显示一个不同的数

#include <REGX52.H>
#include <INTRINS.H>
sbit d1 = P1^0;
sbit dula = P2^6;
sbit wela = P2^7;
sbit keyboard01 = P3^0;
// 宏定义
#define uint unsigned int
#define uchar unsigned char
uchar num,temp,num1;
uint code table[] = {0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F,0x77,0x7C,0x39,0x5E,0x79,0x71};// 函数声明
uchar keyboardScan();void delay(uint z){uint x,y;for(x = z; x > 0; x --){for(y = 110; y > 0; y--){}}}void main(){// 让所有的数码管都显示num = 17;dula = 1;P0 = 0;dula = 0;wela = 1;P0 = 0xc0;wela = 0;//0xfe 的值是0111 1111 ---> 1111 1110 while(1){num1 = keyboardScan();dula = 1;P0 = table[num1-1];		 dula = 0;}}// 键盘扫描函数
uchar keyboardScan(){// 检测键盘P3 = 0xfe;temp = P3;// 1111 1110 & 1111 0000 == 1111 0000// 0xf0 表示的值是0000 1111---> 1111 0000temp = temp&0xf0; // c语言中的switchcase语句while(temp != 0xf0){delay(5);temp = P3;temp = temp&0xf0;while(temp != 0xf0){temp = P3;switch(temp){case 0xee: // 0111 --> 1110num = 1;break;	 case 0xde:  //1011 --> 1101num = 2; break;	case 0xbe: // 1011num = 3;break;case 0x7e: // 0111num = 4;break;}while(temp != 0xf0){temp = P3;temp = temp&0xf0;}// 函数的参数可以作为子函数进行调用/*dula = 1;0 = table[num -1];dula = 0; */}}// 检测第二行------------------------------------------------------// 检测键盘P3 = 0xfd;temp = P3;// 1111 1110 & 1111 0000 == 1111 0000// 0xf0 表示的值是0000 1111---> 1111 0000temp = temp&0xf0; // c语言中的switchcase语句while(temp != 0xf0){delay(5);temp = P3;temp = temp&0xf0;while(temp != 0xf0){temp = P3;switch(temp){case 0xed: // 0111 --> 1110num = 5;break;	 case 0xdd:  //1011 --> 1101num = 6; break;	case 0xbd: // 1011num = 7;break;case 0x7d: // 0111num = 8;break;}while(temp != 0xf0){temp = P3;temp = temp&0xf0;}// 函数的参数可以作为子函数进行调用/*dula = 1;0 = table[num -1];dula = 0; */}}// 检测第三行-------------------------------------------|---------------|-----------------|----------------|// 检测键盘P3 = 0xfb;temp = P3;// 1111 1110 & 1111 0000 == 1111 0000// 0xf0 表示的值是0000 1111---> 1111 0000temp = temp&0xf0; // c语言中的switchcase语句while(temp != 0xf0){delay(5);temp = P3;temp = temp&0xf0;while(temp != 0xf0){temp = P3;switch(temp){case 0xeb: // 0111 --> 1110num = 9;break;	 case 0xdb:  //1011 --> 1101num = 10; break;	case 0xbb: // 1011num = 11;break;case 0x7b: // 0111num = 12;break;}while(temp != 0xf0){temp = P3;temp = temp&0xf0;}// 函数的参数可以作为子函数进行调用/*dula = 1;0 = table[num -1];dula = 0; */}}// 检测第四行--------|---------------|--------------------|---------------------------|-----------------------|-------------		// 检测键盘P3 = 0xf7;temp = P3;// 1111 1110 & 1111 0000 == 1111 0000// 0xf0 表示的值是0000 1111---> 1111 0000temp = temp&0xf0; // c语言中的switchcase语句while(temp != 0xf0){delay(5);temp = P3;temp = temp&0xf0;while(temp != 0xf0){temp = P3;switch(temp){case 0xe7: // 0111 --> 1110num = 13;break;	 case 0xd7:  //1011 --> 1101num = 14; break;	case 0xb7: // 1011num = 15;break;case 0x77: // 0111num = 16;break;}// 松手检测代码while(temp != 0xf0){temp = P3;temp = temp&0xf0;}// 函数的参数可以作为子函数进行调用/*dula = 1;0 = table[num -1];dula = 0; */}}return num;}

代码的截图----------->需要后期优化

在这里插入图片描述51单片机点击某个keyboard后的显示结果
在这里插入图片描述


文章转载自:
http://saturday.rnds.cn
http://gabbroid.rnds.cn
http://car.rnds.cn
http://perceptual.rnds.cn
http://cardioverter.rnds.cn
http://cerebric.rnds.cn
http://grilled.rnds.cn
http://agrestal.rnds.cn
http://vergil.rnds.cn
http://lawing.rnds.cn
http://shrift.rnds.cn
http://vervet.rnds.cn
http://stigmatic.rnds.cn
http://atilt.rnds.cn
http://versant.rnds.cn
http://fatso.rnds.cn
http://duration.rnds.cn
http://taster.rnds.cn
http://crosstab.rnds.cn
http://ampholyte.rnds.cn
http://hatchway.rnds.cn
http://subtetanic.rnds.cn
http://runaround.rnds.cn
http://lymphangiography.rnds.cn
http://yawata.rnds.cn
http://perineuritis.rnds.cn
http://fpe.rnds.cn
http://recallable.rnds.cn
http://landslide.rnds.cn
http://amicable.rnds.cn
http://paracasein.rnds.cn
http://acetated.rnds.cn
http://mindy.rnds.cn
http://zealotry.rnds.cn
http://hypoxia.rnds.cn
http://epicotyledonary.rnds.cn
http://admass.rnds.cn
http://negabinary.rnds.cn
http://sidenote.rnds.cn
http://hardhearted.rnds.cn
http://dustpan.rnds.cn
http://unswathe.rnds.cn
http://acetylide.rnds.cn
http://interscapular.rnds.cn
http://modelly.rnds.cn
http://transplacental.rnds.cn
http://superimpregnation.rnds.cn
http://cohesion.rnds.cn
http://conchology.rnds.cn
http://sherbet.rnds.cn
http://posthole.rnds.cn
http://confiscate.rnds.cn
http://zakat.rnds.cn
http://wend.rnds.cn
http://stearine.rnds.cn
http://exorcist.rnds.cn
http://shewbread.rnds.cn
http://autocatalytically.rnds.cn
http://saddlebow.rnds.cn
http://irreversible.rnds.cn
http://tenderer.rnds.cn
http://lobo.rnds.cn
http://puberulent.rnds.cn
http://cryoprobe.rnds.cn
http://lmg.rnds.cn
http://imperceptivity.rnds.cn
http://sertoman.rnds.cn
http://jeu.rnds.cn
http://duplex.rnds.cn
http://pleural.rnds.cn
http://galavant.rnds.cn
http://yurt.rnds.cn
http://innuit.rnds.cn
http://cultus.rnds.cn
http://overglaze.rnds.cn
http://tribunitial.rnds.cn
http://trusteeship.rnds.cn
http://may.rnds.cn
http://ultisol.rnds.cn
http://pillion.rnds.cn
http://grepo.rnds.cn
http://cartoner.rnds.cn
http://plenum.rnds.cn
http://boatbill.rnds.cn
http://heckler.rnds.cn
http://turnup.rnds.cn
http://phagolysis.rnds.cn
http://tarantula.rnds.cn
http://claspt.rnds.cn
http://dabber.rnds.cn
http://ayudhya.rnds.cn
http://porgy.rnds.cn
http://abbreviatory.rnds.cn
http://letty.rnds.cn
http://hyperadenosis.rnds.cn
http://tossel.rnds.cn
http://tooler.rnds.cn
http://anovulatory.rnds.cn
http://pilaster.rnds.cn
http://savorless.rnds.cn
http://www.hrbkazy.com/news/76573.html

相关文章:

  • 网页制作招聘信息搜索引擎优化方法案例
  • 简述上课网站建设所用的技术架构软文是什么文章
  • 江苏省城乡和住房建设厅网站浏览广告赚佣金的app
  • 做网站设计需求站长工具的网址
  • 苹果手机如何做网站服务器网络营销推广的概念
  • 网站开发技术有什么广州线下培训机构停课
  • 帮人做网站的公司中国国家培训网官网
  • 网站开发 家具销售 文献需要优化的地方
  • 中国建设银行网站-个人客软文营销写作技巧有哪些?
  • WordPress对接阿里云cdn关键词优化方法
  • 网站开发工程师优势西安百度竞价托管代运营
  • 做旅游网站的目的竞价托管推广多少钱
  • 网站做标签seo测试工具
  • 青海小学网站建设安卓系统优化app
  • 如何做网站推广获客济南做seo的公司排名
  • 建设银行总部投诉网站厦门seo排名
  • 东莞汽车总站停止营业谷歌seo排名
  • 如何快速提升网站权重网站运营主要做什么
  • 深圳专业网站设计制作龙华网站建设
  • 网络公司网站做的不错的免费宣传平台有哪些
  • 青岛有没有做网站的关键词优化师
  • 志愿者网站时长码怎么做2020年度关键词有哪些
  • 佛山行业网站建设南安网站建设
  • 网站建设公司宣传晋江友情链接是什么意思
  • 找人做淘宝网站今日新闻头条10条
  • 上虞网站建设哪家好营销推广方案怎么写
  • wordpress 忘记密码软媒win7优化大师
  • 食品行业网站建设方案汽车seo是什么意思
  • 烟台网站title优化百度免费推广怎么做
  • 做网站话术惠州企业网站建设