Untitled Robot Control program moves along.

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/io.h>
#include “noenterkey.h”

#define IN  0x379
#define OUT  0x378
#define FOR  0
#define REV  9
#define RIGHT  3
#define LEFT  12

/*  PARRALELL PORT Driven robot program Version 1.0
Zack Mitchell – May 2015

Needs some “not have to press enter for scanf type stuff”   */
int better(int x)  {

if ( x == ‘4’ )      {  outb(LEFT, OUT); }
else if ( x == ‘8’ )      {  outb(FOR, OUT);  }
else if ( x == ‘2’ )      {  outb(REV, OUT);  }
else if ( x == ‘6’ )      {  outb(RIGHT, OUT);  }
else if ( x == ‘5’ )      {  outb(255, OUT);  }//needs modification for “right”
else { outb(255, OUT); return 0; }

return 1;
}

int TURN(char *something)  {

if ( ! ( strcmp(*something, “left”) ) )      {  outb(LEFT, OUT); }
else if ( ! ( strcmp(*something, “forward” ) ) )  {  outb(FOR, OUT);  }
else if ( ! ( strcmp(*something, “reverse” ) ) )  {  outb(REV, OUT);  }
else if ( ! ( strcmp(*something,  “stop” ) ) )    {  outb(255, OUT);  }//needs modification for “right”
else { outb(255, OUT); return 0; }

return 1;
}

char WHY_NOT(int x)  {

if ( x == 8 )  { return ‘F'; }
else if ( x == 2 )  { return ‘R'; }
else if ( x == 4 )  { return ‘L';    }
else                { return ‘S';    }//needs modification for “right”
}

int RUNNER()  {

int input;

while(1)  {

scanf(“%d”, &input);
better(input);
}
return 1;
}

int RUNNER_2()  {

int input;

noEnter();

while(1)  {

input = getchar();
better(input);
}
return 1;
}

int main()  {

if ( ioperm(IN, 1, 1) == -1 ) { puts(“Input permission falure”);  return 0;  }
else if ( ioperm(OUT, 1, 1) == -1 ) { puts(“Output permissin falure”);  return 0;  }

RUNNER_2();
// Needs ioperm relese mechanism and warnings.
return 0;
}