Library | Building | Programming | Quick Guides Home | Quick Guides to Building | Quick Guides to Programming | LVLM | WeDo

DocumentsDate added

Order by : Name | Date | Hits [ Ascendant ]
file icon While Loop, LED Lamp UseTooltip 06/08/2011 Hits: 357

This example shows the basic use of a while loop.  It also explains how to use the LED Lamps that are included in the Mindstorms kit. 

 

file icon Compute FactorialTooltip 06/08/2011 Hits: 218

This program shows how to execute the concept of recursion (using a function within itself).  The factorial program takes in a number n, and computes n factorial (n!).  n! =  n*(n-1)*(n-2)*(n-3) etc.  By definition, 0! is equal to 1.   This example uses a while loop and a shift register.

 


file icon Modulus FunctionTooltip 06/08/2011 Hits: 222

This program shows the most basic use of the Quotient/Remainder block.  In other programming languages, this function is referred to as the Modulus, and allows the user to use the remainder of an equation.  In this example, the user inputs a number and the program determines (using the Modulus) if the number is even or odd.

 


file icon Conditional LoopsTooltip 06/06/2011 Hits: 228

This example shows how to make a while loop dependent on a condition in order to keep running, instead of depending on a condition in order to stop.

 

file icon Shift Register CountingTooltip 06/06/2011 Hits: 146

This example shows the basic use of a shift register in a while loop.  Shift registers are used to store values from the end of a loop and reuse them at the start of the loop.


file icon WaitingTooltip 06/06/2011 Hits: 240

This example shows how to use the Wait For program.  The program first waits for a touch, moves forward, and then waits again for a touch to brake.

 

file icon Using SequencesTooltip 06/06/2011 Hits: 215

This example shows a flat sequence structure in action.

 

file icon Shift Registers and TimersTooltip 06/06/2011 Hits: 203

This example demonstrates the use of both shift registers and timers.  After resetting the timer, the program reads how long the loop has been running, subtracts the last timer value, and displays the result to the screen, essentially measuring the run time of one iteration.

 

file icon For LoopsTooltip 06/06/2011 Hits: 217

This example shows the use of a for loop, which is useful when you know precisely how many times a loop needs to be run.  The "N" in the top left corner represents the number of iterations the loop will go through.  In this particular example, the motor runs faster depending on which iteration the loop is on.

 

file icon Acceleration and Case StructuresTooltip 06/06/2011 Hits: 190

This example shows how to use shift registers and case structures to produce an effect similar to acceleration.  If the sensor is pressed, the motors stop, but otherwise power is slowly added to the motors.


 

«StartPrev12NextEnd»
Page 1 of 2
Home | About Us | Contact Us
© 2013 Center for Engineering Educational Outreach, Tufts University
© 2013 The LEGO Group. All rights reserved.