#include
//单片机头文件,储存一些殊寄存器的地址声明
#include
//intrins头文件储存51编程中需要使用到空指令_nop_()、字符循环移位指令_crol_等
#include
//stdio : “standard input & output”(标准输入输出),C/C++头文件,把多个编译单元(.c或者.cpp文件)公用的内容,单独放在一个文件里减少整体代码尺寸
#define usint unsigned short int //符号短整型
#define uchar unsigned char //无符号字符型
#define uint unsigned int //无符号整型
#define VALID 0 //0
#define INVALID 1 //1
#define LCD_data P0 //LCD数据端口P0
sbit LCD_RS = P2^7; //LCD命令和数据控制位,1:写数据位,0:写命令
sbit LCD_RW = P2^6; //LCD读写控制位
sbit LCD_EN = P2^5; //LCD使能位
sbit IN1 = P2^0; //电机
sbit IN2 = P2^1;
sbit ENA = P2^3;
uchar code title2[] = {“电机转速:”};
uchar code ascii[] =
{0x31,0x32,0x33,0x41,0x34,0x35,0x36,0x42,0x37,0x38,0x39,0x43,0x2A,0x30,0x23,0x44}; //数字和常用字符的ascii码
uint n = 0;