PDA

View Full Version : program for the keys



b_7e7
03-14-2005, 05:40 PM
I want the .c file for using the arrow keys to run the motor . like up arrow for clock wise and down arrow for Anti clock wise.

or how to find the address of the arrow keys.

plz send it to sarodearun@yahoo.com

vikas
03-14-2005, 07:59 PM
Its differnt for diffrent compilers which one are u using ?

b_7e7
03-14-2005, 10:09 PM
I am using Turbo C

ognjen
05-14-2005, 12:07 AM
can you post the code here...

vikas
05-14-2005, 01:01 AM
#include <conio.h>
#include <stdio.h>

void main()
{
int x,y;

x=getch();
if(x==0)
{
x=getch();
switch(x){
case 75: printf("left");break;
case 77: printf("right");break;
case 72: printf("up");break;
case 80: printf("down");break;

}
}

}

This works 4 turbo c .