Arduino Bubble Sort Array

I have recently worked on a project for my Arduino which follows the following rules:

  • to sort an array of fifty random numbers into ascending or descending order. The numbers are in the range of 0 to 255. The highest and the lowest numbers in the array should be displayed on eight L.E.Ds (as binary).

  • The sorted array should be displayed on the serial monitor using a pointer.

  • The sorting function should be triggered by keyboard input from the serial monitor.

  • The numbers should be randomly generated.

Write the programme in ā€œCā€ and test its functionality.

All of the above I have managed to do with my code, I can open serial monitor successfully, however I have noticed that even though I have a bubble sort algorithm in my code and two sorting functions for highest/lowest numbers, the results shown on the serial monitor are incorrect, the array of numbers isn't sorted and the highest and lowest are sometimes incorrect. This is my third month of learning C and Arduino, helpful advice and guidance would be massively appreciated. Below is my code.

Add some serial prints to help you debug.
Print out key values at known points in the sketch.

Sunny in Brighton today?

Edit: your code seems to have disappeared.
When is our assignment due?