/****************************************************
 *  Motor.c                                         
 *  Created on: 2012/04/17 11:50:57                      
 *  Implementation of the Class Motor       
 *  Original author: hiroyuki.watanabe                     
 ****************************************************/

#include "ecrobot_interface.h"
#include <string.h>
#include <stdlib.h>

#include "Motor.h"

void Motor_init(Motor* this, OUTPUT_PORT a_outputPort)
{
	this->outputPort = a_outputPort;
}

long Motor_getAngle(Motor* this)
{
	return nxt_motor_get_count(this->outputPort);
}

void Motor_rotate(Motor* this, char pwm)
{
	nxt_motor_set_speed(this->outputPort, pwm, 1);
} 




