Page 136 - C Programming
P. 136

ตัวอย่างที่ 10-4  โปรแกรมควบคุมการเปิดปิดดีซีมอเตอร์




                            #include<stdio.h>


                            main()



                                  {  char control;


                                      printf("********************\n");


                                      printf("Program ON/OFF Motor\n");


                                      printf("********************\n");


                                            do{  gotoxy(7,4);    printf("Stop Motor\a");


                                                    outport(0x378,00);   control=getch();



                                                    gotoxy(7,4);    printf("Run Motor \a");


                                                    outport(0x378,01);               control=getch();


                                                   }while(control!=27);


                                       outport(0x378,00);



                                   }
   131   132   133   134   135   136   137   138   139   140   141