#include "TopDefine.h"
#include "FreeRTOS.h"
#include "userTask.h"
#include <cmsis_os2.h>
#include "takeTask.hpp"
#include "remote_control.h"
#include "take.hpp"
#include "motor.hpp"

extern RC_ctrl_t rc_ctrl;
Take take;
Trigger trigger;

int pos=1600;

void FunctionTake(void *argument)
{
	//osDelay(2000);
    while(1)
	{
		if(rc_ctrl.sw[4]==306)
		{
			trigger.triggerFlow(pos);
		}
		else if(rc_ctrl.sw[4]==1694)
		{
			//trigger.triggerZero();
			trigger.result=0;

		}
		else if(rc_ctrl.sw[4]==0)
		{
			//trigger.triggerZero();
			trigger.result=0;
		}
	
		CAN_cmd_200(0,trigger.result,0,0,&hcan1);
		osDelay(1);
	}
}
