当前位置:三九宝宝网 → 宝宝教育 → 教学论文 → 正文

C语言编程数码管显示时钟跟设置闹钟的程序

更新:03-23 整理:39baobao.com
字体:

[C语言程序想从本地读取 word txt中的内容并逐行显示在显示]#include #include #include int main() { char ch; char buffer[1024];//缓冲区 int len = 0; FILE *fp; fp=fopen("/home/lay/Desktop/baby/word/word.txt","r"); if(fp==NULL)...+阅读

给个我以前写的程序,你参考参考,我这个使用1602液晶写的,显示方式需要改改 #include "1602yejing.h" sbit key1=P3^2; //选择调整位置按钮 sbit key2=P3^3; //加一按钮 sbit key3=P3^4; //减一按钮 sbit key4=P3^5; //定时按钮 char shi,fen,miao,T_shi,T_fen,T_miao; uchar count,keynum,flag; uchar code table1[]=" 2011-12-26 1"; uchar code table2[]=" 10:30:30"; uchar code table3[]="input the timing"; uchar code table4[]=" 00:00:00"; void write_sfm(uchar add,uchar date) { uchar shi,ge; shi=date/10; ge=date%10; write_com(0xc0+add); write_date(shi+'0'); write_date(ge+'0'); } void init() { uchar num; shi=10; fen=30; miao=30; P1=0xfe; write_com(0x38);//显示模式 write_com(0x0c);//不显示光标,光标不闪烁 write_com(0x06);//地址指针加一,光标加一 write_com(0x01);//清屏 write_com(0x80); for(num=0;num

用C语言设计一个闹钟定时弹出界面提醒你该吃什么

呵呵,写了一个玩玩:

#include

#include

#include

int main(int argc, char *argv[])

{

SYSTEMTIME time;

SYSTEMTIME clock;

GetLocalTime(&time);

printf("当前时间为:%2d:%2d:%2d\n",time.wHour,time.wMinute,time.wSecond);

printf("请设定闹钟时间:\n");

printf("时:");

scanf("%2d",&clock.wHour);

printf("分:");

scanf("%2d",&clock.wMinute);

while(1)

{

Sleep(1000);

GetLocalTime(&time);

if((time.wHour==clock.wHour)&(time.wMinute==clock.wMinute))

{

printf("\a\a\a时间到!!!");

break;

}

}

return 0;

}

用C语言编写AT89C51单片机程序设计一个智能数字钟

基本要求:1.C语言程序要求是模块化设计。2.该闹钟基于AT89C51单片机及相关外围电路进行设计。3.该闹钟有6个数码管(共阳极),可分别显示时间(时、分、秒)、及定时时间(分、秒)。4.该闹钟有4个按钮,S1是切换显示按键,该键按下时可分别实现切换正常走时显示、设定走时显示、设置定时时间,启动定时,回到正常状态等功能。S2是设定键,即该键按下,将分别选中需要设定的选项。S3键是加键,即按下去表示相应选项加1。S4键是减键,即按下去表示相应的选项减1。5.该闹钟可以定时时间到,LED将发出提示闪光,且持续30s。发挥要求:1.定时时间可被打断,即打断后恢复时继续计时。2.设置闹钟报警功能;3.能切换显示年月日等信息。

本文地址:https://www.39baobao.com/show/29_49139.html

以上内容来自互联网,请自行判断内容的正确性。若本站收录的信息无意侵犯了贵司版权,请联系我们,我们会及时处理和回复,谢谢.

以下为关联文档:

电子日历时钟系统程序汇编语言data segment db "00/00/00 00:00:00",'$' data ends codesg segment assume cs:codesg,ds:data start: mov ax,data mov ds,ax mov cx,6 mov bx,0 mov ah,0 mov al,9 s: push...

编写c语言程序计算并显示任意给定值的阶乘#include <stdio.h> void main() { int i=0,N,j=1; printf("请输入一个整数"); scanf("%d",&N); if(N<0) { printf("错误!"); return; }else if(N==0){ printf("%d的阶乘是1\n",N); return;...

用c语言编电子时钟#include <graphics.h> #include <math.h> #include <dos.h> #include <conio.h> #define PI 3.1415926 /*定义常量*/ #define mid_x 240 /*定义常量*/ #define mid_y 240 /...

用汇编语言做单片机时钟显示基于c8051f020单片机最小系统的实时时钟显示程序c8051f020 FYD12864-0402B LCD显示,按键电子时钟//#include#include#include#define uchar unsigned charvoid lcd_ini();voi...

用汇编语言编写一个时钟程序能显示时分秒的还要有秒表就是计STACK1 SEGMENT STACK DW 200 DUP (?) STACK1 ENDS DATA SEGMENT SPACE DB 1000 DUP (' ') PATTERN DB 6 DUP (' '),0C9H,26 DUP (0CDH),0BBH,6 DUP (' ') DB 6 DUP (' '),0...

求一个用汇编语言编写时钟的程序只要能在pc机上显示时分秒就行1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 5...

c语言倒计时时钟程序如果你有TC,可以试一试。 VC 的 kbhit() 不能返回 键名。 23:59:59 -- 86400 秒 #include <stdio.h> #include <windows.h> #include <conio.h> void main() { long int t; in...

C语言编程保存显示正好以前写过个差不多的程序,我拿来改了一下,纯C是实现不了图形化编程的。这个程序里面用到了一个线程来控制随机显示单词中的退出,其它都是标准C范围,我的编译环境是VC++2008 e...

C语言编图形时钟C语言编图形时钟,整点报时程序DELPHI:试试这个 #include"graphics.h" #define PI 3.1416 #include"math.h" #include"dos.h" main() { int x0=320,y0=240,r0=150; void init_sceen()...