- 博客(20)
- 收藏
- 关注
原创 LCD液晶显示可调时钟
void clock_2() //可调时钟{unsigned char num;init_timer0();while(1){ num = keyscan1(); switch(num) { case 1: hour++;if(hour == 24)hour = 0;break;case 5: hour--;if(hour == 255)hour =
2017-01-24 09:09:13 987
原创 lcd1602液晶
include //包含头文件,一般情况不需要改动,头文件包含特殊功能寄存器的定义#includesbit RS = P2^6; //定义端口 sbit RW = P2^5;sbit EN = P2^7;sbit SPK = P3^0;unsigned char time[] = {'0','1','2','3','4','5','6','7','8',
2017-01-24 09:08:27 1081
原创 可调时钟
void clock() //可调时钟{unsigned char num;init_timer0();while(1){ num = keyscan(); switch(num) { case 1: hour++;if(hour == 24)hour = 0;break;case 2: hour--;if(hour == 255)hour = 23
2017-01-22 20:18:36 1094
原创 按键:0~99加减
void add_dec() //00~99加减{unsigned char num = 0;KEY_ADD = 1;KEY_DEC = 1;P0 =0X00;while(1){if(!KEY_ADD){delayms(10);if(!KEY_ADD){while(!KEY_ADD);{if(numnum++;}}}
2017-01-22 20:17:57 1739
原创 定时器
///60s时钟计时 0~60/* TMOD = 0X01;TH0 = 0X3C;TL0 = 0XB0;EA = 1; //开总中断ET0 = 1; //开定时器0TR0 = 1; //启动定时器0/* while(1){P2 = 0XFE;P0 = LED[sec/10];delay(1);P2 = 0XFD;P0 = LED[s
2017-01-21 22:25:20 263
原创 按键及中断
#include sbit KEY = P1^0;//sbit LED = P0^0;unsigned char LED[16] = {0X3F,0X06,0X5B,0X4F,0X66,0X6D,0X7D,0X07,0X7F,0X6F}; //,0X77,0X7C,0X39,0X5E,0X79,0X71};//~(1~f) 段选unsigned char code dis
2017-01-21 22:23:34 331
原创 动态数码管
//动态数码管#include #define DATAPORT = P0;unsigned char Ledout[] = {0X3F,0X06,0X5B,0X4F,0X66,0X6D,0X7D,0X07};//段选unsigned char code dispbit[8]={0xfe,0xfd,0xfb,0xf7,0xef,0xdF,0xbF,0x7F};//位选
2017-01-20 11:44:34 339
原创 静态数码管
//静态数码管#includeunsigned char LED[16] = {0X3F,0X06,0X5B,0X4F,0X66,0X6D,0X7D,0X07,0X7F,0X6F,0X77,0X7C,0X39,0X5E,0X79,0X71};//~(1~f)//void DELAY(unsigned char i);void t_1();void t_2();void
2017-01-20 11:43:45 316
原创 17/1/19
LED0 = 1; DELAY(100); LED0 = 0; LED1 = 1; DELAY(100); LED1 = 0; LED2 = 1; DELAY(100); LED2 = 0; LED3 = 1; DELAY(100); LED3 = 0; LED4 = 1; DELAY(100); LED4 = 0
2017-01-19 08:55:06 241
原创 1112
source=*.cdest=client$(dest):$(source)gcc -o $(dest) -lpthread $(source)clean:rm $(dest)
2017-01-11 23:53:35 202
原创 1111
source=*.cdest=client$(dest):$(source)gcc -o $(dest) -lpthread $(source)clean:rm $(dest)
2017-01-11 23:53:22 219
原创 client
#include #include #include #include #include /* inet(3) functions */ int handle(int fd); int main(void) { int nsd; char buf[1024]; char * myaddr = "192.168.231.128"; struct soc
2017-01-09 21:21:00 310
原创 service
#include #include #include #include #include #include /* inet(3) functions */ #include #include #include #include int handle(int point); int main(void) {int sfd, ind;struct sockaddr_
2017-01-09 21:19:09 169
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人