随笔分类 -  scm

摘要:#include #include "..\lib\delay.h"typedef unsigned char uchar;typedef unsigned int uint;#define S1 0x7e#define S2 0x7d#define S3 0x7b#define S4 0x77#define S5 0xbe#define S6 0xbduchar PLAY;sbit IN1 =... 阅读全文
posted @ 2012-02-28 23:01 一浩瀚星空一 阅读(991) 评论(0) 推荐(0)
摘要:#include <reg52.h>sbit LED = P1^1;unsigned char count;void main(){ TMOD = 0x01; //工作方式1 ,T/C 0 是一个16位定时器 / 计数器 TH0 = 0x3c; TL0 = 0xb0; EA = 1; ET0 = 1; TR0 = 1; LED = 0; while(1) { }}void T1_timer() interrupt 1{ TH0 = 0x3c; TL0 = 0xb0; count++; if(count ==... 阅读全文
posted @ 2012-02-20 22:15 一浩瀚星空一 阅读(685) 评论(1) 推荐(0)
摘要:1.main.c#include <reg52.h>#include "..\lib\delay.h"#include "..\lib\display.h"#include "..\lib\i2c.h"#define AddWr 0xae //写数据地址,需要参考24c02芯片文档#define AddRd 0xaf //读数据地址sbit WP = P1^0;/*------------------------------------------------ 写入数据--------------------------- 阅读全文
posted @ 2012-01-28 10:34 一浩瀚星空一 阅读(470) 评论(0) 推荐(0)