NXT Programming Software

 

This pseudo-code was written as an outline so developers could "benchmark" the speed of their software.  It includes functionality used in most programs.

It was sent to developers of different languages, and they were asked to write the programs.

The results are posted on the main page.  Here's what the rows represent:

Speed (loops/min): This is the number of times the program ran through the loop in 60 seconds.
Memory (bytes): The size of the program that was downloaded to the NXT
Time to write: The approxamate time it took the "experts" to write the program
Program: The actual program, available for download.  For graphic languages, a graphic of the program is also available



Here's the pseudo-code
-----------
Set A to 0

 Start loop
 Read light sensor(3)
 Read US sensor(4)
 Read & Display Rotation Sensor(B)
 Get random number (1-100) (RN to be used later)
 Display value of:(Light Sensor+US Sensor+Rotation Sensor)*100/(RN)
 Set motor speed for B and C to RN (Using Coast)
 If RN > 50, Increase A by 1
 If RN < 50, Decrease A by 1
 If RN = 50, no change to A
 Display A
 Set motor A speed to A (if A<0, set direction to reverse)
 Display Loop Count
Loop for 60 seconds
Stop Motors
Show display for 10 seconds
-----------

 

We will post a few results, including:
1) Number of iterations the program can execute in 60 seconds
2) Size of program downloaded to the NXT
3) Approximate time it took the experts to write the program
4) The actual program, as text or a graphic