发布时间:2013-08-21 16:46:32
#include <reg52.h>//发送程序unsigned char l,h,key;sbit cs=P3^7; void delay(unsigned t){ while(t--);} void main(){ TMOD=0x20; TH1=0xe8; TL1=0xe8;TR1=1; SM1=1; REN=1;ES=1;EA=1; cs=1.........【阅读全文】
发布时间:2013-08-21 16:46:24
AD转换:#include<reg52.h>#include<intrins.h>sbit rs=P2^0;sbit rw=P2^1;sbit e=P2^2;sbit dout=P2^3;sbit addr=P2^4;sbit cs=P2^5;sbit clk=P2^6;sbit eoc=P2^7;void delay(int t){ while(t--);}void write_com(unsigned char com){ e=0; rs=0; &nb.........【阅读全文】
发布时间:2013-08-21 16:46:19
AD转换:方波#include<reg52.h>#include<math.h>#define uchar unsigned char#define uint unsigned sbit SCLK=P2^0;sbit CS=P2^1;sbit DIN=P2^2;sbit p=P2^3;float x,y;void delay(uchar t){ while(t--);}void WRITE(int DATA){ uchar i; CS=0; SCLK=0; DATA<<=2; for(i=1.........【阅读全文】
发布时间:2013-08-21 16:46:09
温度采集:c:DS18B20.zip#include<reg52.h>#include<intrins.h>#define uchar unsigned char#define uint unsignedsbit rs=P2^4;sbit rw=P2^5;sbit e=P2^6;sbit dq=P2^3;uchar zm1[]=" temperature: ";uchar zm2[]=" 00.0 c ";uchar zm3[]=" NO DS18B20.........【阅读全文】
发布时间:2013-08-21 16:46:04
24c02密码为55;c:#include#include#define uchar unsigned char#define uint unsignedsbit rs=P2^4;sbit rw=P2^5;sbit e=P2^6;//////////sbit sda=P2^1;sbit scl=P2^0;sbit s=P2^2;uchar zm1[]="Password please!";uchar zm2[]="----- ------";uchar dat[2]="22";unsig.........【阅读全文】