// Wheels: Controls the wheels
#ifndef WHEELS_H
#define WHEELS_H
#include "io.h"

class Wheels {
	public:
		Wheels(IO *oIO_ptr);  // Constructor
		~Wheels(); // Destructor
		int getAngleTime(int angle);
		bool SetDesired(int speed, float angle); // sets the desired motor speed by direction
		bool SetDesiredByPercent(int motor_num, int percent); // sets the desired motor speed by motor
		int  GetDesired(int motor_num);      // gets the desired motor speed
		int  GetCurrent(int motor_num);      // gets the current motor speed
		void Update();             // resolves differences between Desired and Current
		void Demo();  // runs a short demo to verify that the motors work
		void GoDesired(int speed, int time, bool &motorTimerOn, int &motorTimerCount, int &curTimerThreshold);
		void GoDesiredAngle(int angle,bool &motorTimerOn, int &motorTimerCount, int &curTimerThreshold);
		void timer_handler(int x);
	private:
		IO *oIO; // pointer to the IO object
		int cur_L;
		int cur_R;
		int des_L;
		int des_R;
};

#endif

