stc12c5a60s2单片机FFT程序
#include<> #include<> #define uchar unsigned char
#define uint unsigned int
sbstc12c5a60s2单片机FFT程序
#include<> #include<> #define uchar unsigned char
#define uint unsigned int
sbit E=P2^7;
sbit RW=P2^6; sbit RS=P2^5;
sbit g0=P1^0;
sbit g1=P1^1;
sbit g2=P1^2;
sbit g3=P1^3;
sbit g4=P1^4;
sbit g5=P1^5;
sbit g6=P1^6;
bit e0=0;
bit e1=0;
bit e2=0;
bit e3=0;
bit e4=0;
bit e5=0;
bit e6=0;
bit first=1;
void delay(uchar i,j) {
uchar a,b;
for(a=0;a<i;a++)
for(b=0;b<j;b++); }
bit Busy(void)
{
bit busy_flag = 0;
RS = 0;
RW = 1;
E = 1;
delay(1,5);
busy_flag = (bit)(P0 & 0x80);
E = 0;
return busy_flag; }
void wcmd(uchar del) {
while(Busy());
RS = 0;
RW = 0;
E = 0;
delay(1,5);
P0 = del;
delay(1,5);
E = 1;
delay(1,5);
E = 0;
}
void wdata(uchar del)
{
while(Busy());
RS = 1;
RW = 0;
E = 0;
delay(1,5);
P0 = del;
delay(1,5);
E = 1;
delay(1,5);
E = 0;
}
void L1602_init(void)
{
wcmd(0x38);
wcmd(0x0c);
wcmd(0x06);
wcmd(0x01);
}
void L1602_char(uchar hang,uchar lie,char sign)
{
uchar a;
if(hang == 1) a = 0x80;
if(hang == 2) a = 0xc0;
a = a + lie - 1;
wcmd(a);
wdata(sign);
}
void L1602_string(uchar hang,uchar lie,uchar *p)
{
uchar a,b=0;
if(hang == 1) a = 0x80;
if(hang == 2) a = 0xc0;
a = a
stc12c5a60s2单片机FFT程序 来自淘豆网www.taodocs.com转载请标明出处.