单片机
小庄梦蝶
这个作者很懒,什么都没留下…
展开
-
51单片机使用T0定时器显示数码管
#include "reg52.h"typedef unsigned int u16;typedef unsigned char u8;sbit LSA=P2^2;sbit LSB=P2^3;sbit LSC=P2^4;u16 code numList[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0xff,0x67,0x77,0x7c,0x39,0x5e,0x79,0x71};void setInterrup(){ TH0=0xfc; TL0原创 2021-11-29 21:23:54 · 1304 阅读 · 0 评论 -
学习一段日子的单片机,重写LED流水灯
#include "reg52.h" #define LED P2 #define uInt8 unsigned int uInt8 array[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f}; void del(uInt8 i){ while(i--); } void ledOne(){ uInt8 i=0; for(i;i<8;i++){ LED=array[i]; del(8000); LED=0xff; del.原创 2021-11-14 10:45:28 · 515 阅读 · 0 评论 -
普中A2单片机每个数码管轮播0-7
#include "reg52.h" typedef unsigned int u16; typedef unsigned int u8; sbit LSA=P2^2; sbit LSB=P2^3; sbit LSC=P2^4; unsigned char code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07}; void delay(u16 i){ while(i--); } void everyItem(){ u8.原创 2021-11-07 10:53:15 · 141 阅读 · 0 评论 -
普中A2单片机单个数码管轮播0-7
#include "reg52.h" typedef unsigned int u16; typedef unsigned int u8; sbit LSA=P2^2; sbit LSB=P2^3; sbit LSC=P2^4; unsigned char code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07}; void delay(u16 i){ while(i--); } void Led(){ u8 i; .原创 2021-11-06 22:07:17 · 150 阅读 · 0 评论 -
普中单片机A2数码管静态显示0到7
#include "reg52.h" typedef unsigned int u16; typedef unsigned int u8; sbit LSA=P2^2; sbit LSB=P2^3; sbit LSC=P2^4; //编码,这个暂时不清楚 unsigned char code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07}; void delay(u16 i){ while(i--); } void Led(.原创 2021-11-05 21:48:44 · 755 阅读 · 0 评论 -
普中A2关于数码管轮播8
代码如下:#include "reg52.h" typedef unsigned int u16; typedef unsigned int u8; sbit LSA=P2^2; sbit LSB=P2^3; sbit LSC=P2^4; void delay(u16 i){ while(i--); } void Led(){ u8 i; for (i=0;i<8;i++){ delay(2000); P0=0xff; switch(i){原创 2021-11-03 23:48:22 · 157 阅读 · 0 评论