Page 205 - C Programming
P. 205
ตัวอย่างที่ 16.6 โปรแกรมควบคุมการทํางานของแขนกล
#include <stdio.h>
main()
{ char control;
clrscr();
gotoxy(30,12); printf("PROGRAM CONTROL ROBOT");
do{
if(kbhit()) control=getch();
/******motor1 catch and releasr*******/
if(control=='1'||control==79)
{ outport(0x378,0x01);
gotoxy(35,13); printf(" CATCH ");
}
else if(control=='3'||control==81)
{ outport(0x378,0x02);
gotoxy(35,13); printf(" RELEASE ");
}