
void bubbleSort(unsigned char my_array[], unsigned char array_size); //prototype

unsigned char my_array[5] = {9,4,2,8,3}; //my array initialized out of order

void bubbleSort(unsigned char my_array[], unsigned char array_size) //sort it
{
  unsigned char i, j, temp;

  for (i = (array_size - 1); i >= 0; i--)
  {
    for (j = 1; j <= i; j++)
    {
      if (my_array[j-1] > my_array[j])
      {
        temp = my_array[j-1];
        my_array[j-1] = my_array[j];
        my_array[j] = temp;
      }
    }
  }
}

void main (void)//main program
{
										  
while(1)//Loop this section forever
   {    
    	
    bubbleSort(my_array, 5); //sort forever test
	 
	
   }
}
