<commit_before>#include "taskFlyport.h"

void FlyportTask()
{

WFConnect(WF_DEFAULT);
while (WFStatus != CONNECTED);
UARTWrite(1,"Flyport connected... hello world!\r\n");	

extern int myGlobal;
extern int myGlobal2;

const float left = 8.25; //here we set max   2ms
const float right = 4; //and here the min  1ms
const float middle = 6.15; // 1.23ms
const float stop = 5.15; // 5.15ms
const float down = 8; // 8ms

float work = (float)left;
float work2 = (float)left;
PWMInit(1, 50,left);
PWMInit(2, 50,left);
PWMOn(d1out, 1);
PWMOn(d4out, 2);



while(1)
{
	if((myGlobal == 0))
	{
		//forward
		for (work = left; work > right; work--)
			{
			PWMDuty(work, 1);
			vTaskDelay(5); //used to slow down the effect
			}
					vTaskDelay(50);
		for (work = right; work < left; work ++)
			{
				PWMDuty(work, 1);
				vTaskDelay(5); //used to slow down the effect
			}
			vTaskDelay(50); 
	}
	
	if((myGlobal == 1))
	{
		//Stop
		
		PWMDuty(middle, 1);
		vTaskDelay(10); //used to slow down the effect
		
	}
	
	if((myGlobal == 2))
	{
		//Left
		for (work = middle; work < left; work++)
		{
			PWMDuty(work, 1);
			vTaskDelay(15); //used to slow down the effect
		}
		for (work = left; work > middle; work --)
		{
				PWMDuty(work, 1);
				vTaskDelay(15); //used to slow down the effect
		}
	}
	
	
	if((myGlobal == 3))
	{
		//right
		for (work = middle; work > right; work--)
		{
			PWMDuty(work, 1);
			vTaskDelay(15); //used to slow down the effect
		}
		for (work = right; work < middle; work ++)
		{
				PWMDuty(work, 1);
				vTaskDelay(15); //used to slow down the effect
		}
	}
	
	
	
	if((myGlobal2 == 0))
	{
	
	}
	
	// Looks like this has not been implemented yet, commenting out
	//if((myGlobal2 == 4))
	//{
		//Up
		//work2 > right, work2--;)//work2 = left - 0.5;
			
		//	PWMDuty(work2, 2);
		//vTaskDelay(5); //used to slow down the effect
		//for (work = right; work < middle; work ++)
		//	{
		//		PWMDuty(work, 2);
		//		vTaskDelay(15); //used to slow down the effect
		//	}
		//	myGlobal2 = 0;
		
	//}
	
	
	// Looks like this has not been implemented yet, commenting out
	//if((myGlobal2 == 5))
	//{
		//Down = 8ms
		//work2 = down; 
		//work2 < down; //work2++) 
		//PWMDuty(work2, 2);
		//vTaskDelay(30); //used to slow down the effect
		
		//for (work2 = right; work2 < middle; work2 ++)
		//	{
		//		PWMDuty(work2, 2);
		//		vTaskDelay(15); //used to slow down the effect
		//	}
	//}
	
		
	//Fishmsg msg;
	//int i = 0;
	//char str[10];
	//double data = 0;
	//i = 0;
		
	//xQueueReceive(xFlyportQueue,&msg,0);
	//i = msg.message_type;
	//data = msg.message_data;

	//sprintf(str, "Value %d\r\n", i);
	//UARTWrite(1, str);

	//sprintf(str, "Value %.2f\r\n", data);
	//UARTWrite(1, str);
		
		
		

	
	}
}<commit_msg>- Added Murray's new movement code to the taskFlyport.c class. - The new code appears to control the ballast.<commit_after>#include "taskFlyport.h"

void FlyportTask()
{

WFConnect(WF_DEFAULT);
while (WFStatus != CONNECTED);
UARTWrite(1,"Flyport connected... hello world!\r\n");	

extern int myGlobal;
extern int myGlobal2;

const float left = 8.25; //here we set max   2ms
const float right = 4; //and here the min  1ms
const float middle = 6.15; // 1.23ms
const float stop = 5.15; // 5.15ms
const float down = 8; // 8ms

float work = (float)left;
float work2 = (float)left;
PWMInit(1, 50,left);
PWMInit(2, 50,left);
PWMOn(d1out, 1);
PWMOn(d4out, 2);



while(1)
{
	if((myGlobal == 0))
	{
		//forward
		for (work = left; work > right; work--)
			{
			PWMDuty(work, 1);
			vTaskDelay(5); //used to slow down the effect
			}
					vTaskDelay(50);
		for (work = right; work < left; work ++)
			{
				PWMDuty(work, 1);
				vTaskDelay(5); //used to slow down the effect
			}
			vTaskDelay(50); 
	}
	
	if((myGlobal == 1))
	{
		//Stop
		
		PWMDuty(middle, 1);
		vTaskDelay(10); //used to slow down the effect
		
	}
	
	if((myGlobal == 2))
	{
		//Left
		for (work = middle; work < left; work++)
		{
			PWMDuty(work, 1);
			vTaskDelay(15); //used to slow down the effect
		}
		for (work = left; work > middle; work --)
		{
				PWMDuty(work, 1);
				vTaskDelay(15); //used to slow down the effect
		}
	}
	
	
	if((myGlobal == 3))
	{
		//right
		for (work = middle; work > right; work--)
		{
			PWMDuty(work, 1);
			vTaskDelay(15); //used to slow down the effect
		}
		for (work = right; work < middle; work ++)
		{
				PWMDuty(work, 1);
				vTaskDelay(15); //used to slow down the effect
		}
	}
	
	
	
	if((myGlobal2 == 0))
	{
	
	}
	
	// Looks like this has not been implemented yet, commenting out
	//if((myGlobal2 == 4))
	//{
		//Up
		//work2 > right, work2--;)//work2 = left - 0.5;
			
		//	PWMDuty(work2, 2);
		//vTaskDelay(5); //used to slow down the effect
		//for (work = right; work < middle; work ++)
		//	{
		//		PWMDuty(work, 2);
		//		vTaskDelay(15); //used to slow down the effect
		//	}
		//	myGlobal2 = 0;
		
	//}
	
	
	// Looks like this has not been implemented yet, commenting out
	//if((myGlobal2 == 5))
	//{
		//Down = 8ms
		//work2 = down; 
		//work2 < down; //work2++) 
		//PWMDuty(work2, 2);
		//vTaskDelay(30); //used to slow down the effect
		
		//for (work2 = right; work2 < middle; work2 ++)
		//	{
		//		PWMDuty(work2, 2);
		//		vTaskDelay(15); //used to slow down the effect
		//	}
	//}
	
		
	//Fishmsg msg;
	//int i = 0;
	//char str[10];
	//double data = 0;
	//i = 0;
		
	//xQueueReceive(xFlyportQueue,&msg,0);
	//i = msg.message_type;
	//data = msg.message_data;

	//sprintf(str, "Value %d\r\n", i);
	//UARTWrite(1, str);

	//sprintf(str, "Value %.2f\r\n", data);
	//UARTWrite(1, str);
		
		
	//Ballast Control - Up Movement
	if(myGlobal2 == 4)
	{
		work2 > right, work2--;//work2 = left - 0.5;
		PWMDuty(work2, 2);
		myGlobal2 = 0;
	}
	
	//Ballast Control - Down Movement
	if((myGlobal2 == 5))
	{
		//Down = 8ms
		work2 = down; 
		//work2 < down; //work2++) 
		PWMDuty(work2, 2);
		vTaskDelay(30); //used to slow down the effect
	}	

	
	}
}
{'fraction_non_alphanumeric': 0.17922122088080258, 'fraction_numerical': 0.03893895595987077, 'mean_word_length': 2.4078794901506373, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '86361', 'n_tokens_mistral': 2782, 'n_tokens_neox': 2336, 'n_words': 648}