?? wstepper.c
字號:
/*PC BASED WIRELESS STEPPER MOTOR CONTROL*/#include<stdio.h>#include<conio.h>#include<dos.h>void main(){void dub(void);char ex[26]={"Programmed by V.MARIYAPPAN"};int i;char ex1[22]={"Programming Language:C"};int j;char ex2[28]={"Operating system: Windows 98"};int k;char ex3[39]={"PC BASED WIRELESS STEPPER MOTOR CONTROL"};int l;clrscr();for(l=0;l<39;l++){textcolor(14);gotoxy(21+l,9);cprintf("%c",ex3[l]);delay(50);}sound(1900);delay(500);nosound();delay(100);for(i=0;i<26;i++){textcolor(11);gotoxy(27+i,16);cprintf("%c",ex[i]);delay(30);}for(k=0;k<28;k++){textcolor(9);gotoxy(26+k,18);cprintf("%c",ex2[k]);delay(30);}for(j=0;j<22;j++){textcolor(9);gotoxy(29+j,20);cprintf("%c",ex1[j]);delay(30);}sound(1800);delay(500);nosound();getch();dub();}void dub(void){int i;char ex[29]={"For any clarification contact"};int j;char ex1[31]={"Email-marietech2003@yahoo.co.in"};int k;void clock(void);void anty(void);char ch;clrscr();textcolor(14);gotoxy(20,6);cprintf("PC BASED WIRELESS STEPPER MOTOR CONTROL");textcolor(11); gotoxy(24,14);cprintf("FOR CLOCKWISE ROTATION PRESS 'c'");textcolor(11);gotoxy(22,16);cprintf("FOR ANTICLOCKWISE ROTATION PRESS 'a'");textcolor(9);gotoxy(31,20);cprintf("FOR EXIT PRESS 'q'");ch=getch();switch(ch){ case 'c':clock();break; case 'a':anty();break; case 'q': clrscr(); { for(j=0;j<29;j++) { textcolor(9);gotoxy(27+j,14); cprintf("%c",ex[j]); delay(30); } for(k=0;k<31;k++) { textcolor(9);gotoxy(26+k,15); cprintf("%c",ex1[k]); delay(30); } outport(0x0378,0); textcolor(14);gotoxy(1,25); cprintf("Press any key"); getch(); exit(0); } default: clrscr(); textcolor(12);gotoxy(33,14); cprintf("WRONG KEY PRESSED"); for(i=0;i<5;i++) { sound(1000); delay(100); nosound(); delay(100); } dub(); } getch(); }void clock(void){int p=0x0378;char e;clrscr();textcolor(14);gotoxy(31,12);cprintf("CLOCKWISE DIRECTION");textcolor(9);gotoxy(1,25);cprintf("Press any key to stop");do{outport(p,1);delay(200);outport(p,2);delay(200);outport(p,4);delay(200);outport(p,8);delay(200);outport(p,0);sound(1000);delay(200);nosound();}while(!kbhit());getch();dub();}void anty(void){int p=0x0378;char e;clrscr();textcolor(14);gotoxy(30,12);cprintf("ANTI CLOCKWISE DIRECTION");textcolor(9);gotoxy(1,25);cprintf("Press any key to stop");do{outport(p,8);delay(200);outport(p,4);delay(200);outport(p,2);delay(200);outport(p,1);delay(200);outport(p,0);sound(2000);delay(200);nosound();}while(!kbhit());getch();dub();}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -