// IO:   All the actual IO processes
#ifndef IO_H
#define IO_H
#include <termios.h> // serial

class IO {
	public:
		IO();  // Constructor
		~IO(); // Destructor
		unsigned char GetParallel(int port);       // read the parallel port, callback
		void SendSerial(unsigned char *val, int length); // send a char
		bool SetMotor(int motor_num, int val);     // convert percent to a number (+-127)
		bool SetServo(int motor_num, int percent); // absolute position
	private:
		int fd_parallel;
		int fd_serial;
		struct termios oldtty; /* will be used to save old port settings */
};

#endif
