Robojoy challenge class

4-4-1 Find the minimum and maximum

  • Page:
  • 1
  • 2
  • 3
  • 4

Seeking maximum (continued)

I tried to figure the workings of this program. Two boxes are the form of a numeric variable. It is a variable called "present value" and "maximum value".
At first, "0" is on the "maximum". The measured value of the sensor enters to "present value", but I put "10" in this case.

Compare the contents of the box (variable), if the present value is greater, you assign the value to the maximum.

I do not assign to the box if the present value was smaller. In other words, to continue the process of "it is assigned if a variable is larger" and the maximum value is eventually falls to a variable.
This is a "algorithm that seeks the maximum value".

Here is the process from when exiting the loop. I have to convert the maximum value to the text and display on LCD.
I have placed the waiting block at the end for not disappear after displaying on the screen.

It is a consequence of the running program. It moved safely. Has been shown as "52" in this case, it is the maximum value in 100 times measured.

  • Page:
  • 1
  • 2
  • 3
  • 4