-
-
...es 仿真,单片机仿真数码管程序,仿真单片机#include<reg51.h>
sbit P1_0=P1^0;
code unsigned char seven_seg[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,
0x82,0xf8,0x80,0x90};
void delay(unsigned char x)
{
while(x--);
}
void display()
{
unsigned char i;
P0=0...
-
-
DS18B20 protus仿真#include <at89x51.h>//用AT89C51时就用这个头文件
//#include <reg52.h>//用华邦W78E58B时必须用这个头文件
#include <absacc.h>
#include <ctype.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <...
-
-
...es 仿真,单片机仿真电子表程序,仿真电子表#include<reg51.h>
#include<DEFINE.c>
#include<KEY.c>
#include<DISPLAY.c>
void timer_isr()interrupt 1 //中断服务函数
{
TL0 = (65536-2000) %256; //TL0重置函数
TH0 = (65536-2000)/256...
-
-
...存器实现单片机PWM功能, 单片机产生PWM波形#include<reg51.h>
sfr CCON = 0xd8; //可编程计数器PCA的控制寄存器
sfr CMOD = 0xd9; //可编程计数器工作模式寄存器
sfr CL = 0xe9; //可编程计数器的低八位
sfr CH = 0xf9; //可编程计数...
-
-
#include <reg51.h>#define uchar unsigned char sbit P1_0=P1^0;sbit P1_1=P1^1;sbit P1_2=P1^2;sbit P1_3=P1^3;sbit P1_4=P1^4;sbit P1_5=P1^5;sbit P1_6=P1^6;sbit P1_7=P1^7;uchar RRR,flg,KKK; //RRR用于调速控制;flg=0正转;flg=1反转; flg=2不转;KKK为P1的状态寄存uchar loop[2][...
-
-
步进电机控制程序液晶显示#include <reg51.h>
#define uchar unsigned char
sbit P1_0=P1^0;sbit P1_1=P1^1;sbit P1_2=P1^2;sbit P1_3=P1^3;
sbit P1_4=P1^4;sbit P1_5=P1^5;sbit P1_6=P1^6;sbit P1_7=P1^7;
uchar RRR,flg,KKK; //RRR用于调速控制;flg=0正转;flg=1反转; flg=2...
-
-
超大屏幕点阵显示#include<reg51.h>
typedef unsigned char uchar;
typedef unsigned int uint;
sbit E1=P3^4;
sbit ST=P3^5;
sbit SS=P3^6;
unsigned char code mo[6][2][16]=
{{{0x00,0x00,0x01,0x02,0x12,0x13,0x1E,0xF2,0x23,0x24,0x24,0x04,0x07,0x00,0x00,0x00},...
-
-
...文字库数组
***************************************/
#include <reg51.h>
#define uchar unsigned char
#define uint unsigned int
#define High 1
#define Low 0
#define _nop {}
#define PAGEADD 0xb8
#define TIERADD 0x40
#define DIS_STARADD 0xc0
uint key_value;
sbit DI=P1^4;
sbit E=P1...
-
-
...4章 √ √ 仿真、B105开发板 项目7-PC机与51单片机串行通信 第4章 √ B105开发板 项目8-可变脉宽波形出(思考题) 第4章 √ 仿真、B105开发板 项目9-单片机音乐程...
-
-
485全双工通信 #include <reg51.h>
#include <absacc.h>
#define uchar unsigned char
#define uint unsigned int
//uchar idata buf[10]={0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09};
uchar dat1,dat2;
uchar pf;
uchar flag,flag1;
sbit key1=P1^0;
sbit key2=P2^0;
...