Page 204 - C Programming
P. 204

ตัวอย่างที่ 16.1 โปรแกรมควบคุมแขนกลให้หมุนซ้ายขวา





                    #include <stdio.h>


                    main()


                      { clrscr();


                        gotoxy(30,12); printf("PROGRAM CONTROL ROBOT");


                        /*******Robot turn left*******/


                        outport(0x378,0x10);


                        gotoxy(35,13); printf("TURN  LEFT");

                        getch();


                        /******Robot turn right*******/


                        outport(0x378,0x20);


                        gotoxy(35,13); printf("TURN RIGHT");


                        getch();outport(0x378,0x00);


                      }
   199   200   201   202   203   204   205   206   207   208   209