Weston Middle School

Technology/EngineeringCourse Materials

Weston, Massachusetts
| Home | Lego Robotics | Grade 7 Design-Construction | Grade 8 Design-Construction | Links |
Lego NxT Roboticst-Variables Part 2ditRegion3

Course Home

Syllabus

Course Calendar

Activities and Projects

Building References

Programming References

Presentations

Gallery

Frameworks

Additional Info

Part 1:

Challenge: Write a program which increases the power to the motors by 10% each time the button is pushed.


Create new number variable- POWER

Algorithm:

Loop

  • wait for bump
  • read value of Power, Add 10, update( write new) value of Power
  • set Power of motors, beep
  • Display Power #

End of Loop

Part II- Challenge: Write a program which increments Power in steps of 10; if Power> 100, resets to 0 ( and starts over)

  • Loop
    • wait for bump
    • read value of Power, Add 10, update( write new) value of Power
    • Compare Value ( Compare Block)-is Power>100?
    • Switch( Value, Logic)-if Compare value True, reset Power to 0; if not , leave alone
    • set Power of motors, beep
    • Display Power #
  • End of Loop

Links

 

 

EditRegion5
 
Revised January 2011 by Jonathan Dietz, dietzj@mail.weston.org