LEGO Engineering

| | | | | | | |
Using the Timer and RCX Display


23rd of April, 2010

(2 )
50% thumbs up 50% thumbs down

The RCX display block, found in the "RCX Communications" palette, is a great way to see what data the RCX is taking in. It can be used to show readouts of container or sensor values, and even the RCX's internal timer.  The program below is for a simple stopwatch. It uses one touch sensor to start and stop the clock, and another to reset it. This is a great program for learning about timers, jump and land loops, and events.

timer.jpg

The program waits for touch sensor 1 to be pressed, then zeros the container and timer. Next, an event is set up to look for a second press of touch sensor 1. The value of the timer is placed in the yellow container and then is displayed on the RCX. The blue jump and land loop will refresh the screen with new times. The "1" modifier on the "Set Display" block is set to display 1 decimal point. The RCX will continue to show the value of the timer until the event is triggered, at which point the display will stop updating. When touch sensor 2 is pressed, the display will be reset and the program will restart.

Remember that timers and containers both need to be zeroed before they can be used. Otherwise, old data stored in the container could be carried over into your program. Once they have been zeroed, timer blocks will start automatically.





PLN
ses
   :
   :
* :
* :
 


Home | About Us | Contact Us

© 2013 Center for Engineering Educational Outreach, Tufts University
© 2013 The LEGO Group. All rights reserved.