该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
#include
#include
#include "XPT2046.h"
//--定义使用的IO--//
#define GPIO_DIG P0//数码管IO口
sbit LSA = P2^2;
sbit LSB = P2^3;
sbit LSC = P2^4;
#define GPIO_KEY P1 //独立键盘用P1口
#define KEYUP_VAL0xEF//P1.4 增加
#defineKEYDOWN_VAL0xDF//P1.5 减小
const unsigned char code DIG_CODE[17]={
0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,
0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};
static uchar DisplayData[8];//用来存放要显示的8位数的值
static unsigned int g_iPressVal;//压力数据
static unsigned int g_iSpeedVal;//速度数据
static unsigned int g_iPowerVal;//功率数据
void Delay10ms(unsigned int c) //误差 0us
{
unsigned char a, b;
for (;c>0;c--)
{
for (b=38;b>0;b--)
{
for (a=130;a>0;a--);<