Home

RoboLab Reference Guide - Utah State 4-H

image

Contents

1. 288 Value of Blue Hysteresis 291 Value of Blue Lower TAPE G S MOA O isscacssesosctenesgaznaseensiewe 290 Value of Blue Timer 284 Value of Blue Upper TA OSC Ui Givcdeceicecavecsisecceteuecarsenys 289 Value of CLOCK 277 Value of Container s Container eeesererersetictetecen esses 282 Value of Encoder A 00 314 Value of Encoder B 315 Value of Encoder C e 315 Value of Firmware 278 Value of Generic Container EIE IETA 283 Value of Generic Duration ENEE I EE E A EE E 292 Value of Generic Event 288 Value of Generic Hysteresis E E E E ese densoee 291 Value of Generic Lower Tnreshol O ennea 290 Value of Generic Upper TAresSDoO lO esuseenineniisn 289 Value Of Loop Counter Container ssesseesssserssssers 294 Value of Mail 285 Value of Port 280 Value of Port 1 307 Value of Port 2 280 307 Value of Port 3 280 307 Value of Port 4 307 311 Value of Port 5 307 Value of Port 6 307 Value of Port 7 eese 307 Value of Port 8 307 Value of Red Data Set 286 Value of Red Duration 292 Value of Red Event 0 288 Value of Red Hysteresis 291 Value of Red Lower Threshold vcsssiscecenewemmsasceeacccevess 290 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can
2. 118 Loop While NXT Light Sensor is Greater Than 117 Loop While NXT Light Sensor is Less Than 117 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com Loop While NXT Motor Angle Sensor is Greater Than 119 Loop While NXT Motor Angle Sensor is Less Than 119 Loop While pH is Greater TOAN er EE 126 Loop While pH is Less Than PE E AAE E E EEN A 126 Loop While Points in Data Set are Less Than 122 Loop While Position is Greater Than 130 Loop While Position is Less T a oe EE 130 Loop While Pressure is Greater Thanos 127 Loop While Pressure is Less A a E AR 127 Loop While Rotation Sensor is Greater Than 111 Loop While Rotation Sensor is Less Than eeesessssssssese 111 Loop While Sound Level is Greater Than 128 Loop While Sound Level is LESS TAa eee eer eee 128 Loop While Temperature C is Greater Than 0 129 Loop While Temperature C 1o ECSS TN eee ee 129 Loop While Timer is Greater TA IW erara 112 Loop While Timer is Less AL AW E EA EA A E 112 Loop While Touch Sensor is PUS NE decanen 105 106 Loop While Value of Generic Sensor is Greater Than 124 Loop While Value of Generic Sensor is Less Than 124 Loop While Voltage Sensor is Great
3. education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 355 LA Use this to continuously grab sounds from the E microphone This is the same as running a Grab Sound grab sound command in continuous mode Continuously Example This piece of code initializes the microphone continuously grabs a sound and analyzes its frequency i Use this to grab a sound from the microphone Grab Sound Example This piece of code initializes the microphone grabs a sound and saves it as a wav file i Use this to analyze a sound you have taken ha Frequency Analysis Example This piece of code initializes the microphone continuously grabs a sound and analyzes its frequency education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 356 i Use this like an End icon Each string of a 5 microphone program will need one of these Close Mic Example This piece of code initializes the microphone continuously grabs a sound and analyzes its frequency Use this to save a sound from the microphone as a LE
4. This code turns on motors A and C in the forward direction When touch sensor 1 is pushed motors A and C turn off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 32 This behavior is Drive to Dark It makes the car drive forward until the light sensor reading Drive To drops This behavior is written for a two motor Dark car In any behavior you can modify the code to fit your needs Example This code turns on motors A and C in the forward direction When the light sensor reading falls by five the default motors A and C turn off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 33 This behavior is Two Button Remote It allows you to control the direction your car drives with two Two touch sensors This behavior is written for a two Button motor car In any behavior you can modify the Remote code to fit your needs Example This code is written for the motors to be connected to ports A and C and touch sensors to be connected to ports 1 and 2 A task split is used so that each mot
5. This piece of code takes data from the Red Bin fits a line to it and puts the plot in the Brown Bin education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineering com 333 re Use this command to fit a curve to your data You can specify the curve order fit using a numeric Fit constant The coefficients and equation of the Curve line can be displayed on the front panel Example This piece of code takes the data in the Red Bin fits a 3rd order curve to it and plots the result in the Brown Bin The equation of the curve is displayed on the front panel using an indictor education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com Fit Exponential Histogram 334 Use this command to fit an exponential curve to your data The damping amplitude and equation of the line can be displayed on the front panel Example This piece of code takes the data in the Red Bin fits an exponential curve to it and plots the result in the Brown Bin The equation of the curve is displayed on the front panel using an indicator
6. education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 303 Use this icon to send direct mode commands to a specific tower if you have multiple towers on Begin your computer and an RCX is in front of that direct EOWEr mode Example This piece of code would run motor A for 1 second in direct mode RCX in front of tower Use this icon to send direct mode commands to a specific tower if you have multiple towers on Generate your computer and an RCX is in front of that LASM tower command Example This piece of code would send the LASM command plays 5 to the RCX education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 304 Use this to change the value of any modifier to any value you want modifier value Example This piece of code waits for a random amount of time then sets the blue container to the value of the yellow timer It then turns on motor A and waits for the value of the blue container It then turns off motor A LEGO the LEGO logo and MINDSTORMS are trademark
7. 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com ai Use this command to subtract a value from the ees current value of the container The default is T Fron to subtract one from the Red Container Container Example This piece of code fills the Blue Container with a value of 1 It then subtracts 2 from the Blue Container The value of the Blue Container would then be displayed on the RCX as 1 Use this command to multiply the value of a ee container by a certain number The default is Multiply to to multiply the Red Container by two Container Example This piece of code fills the Blue Container with a value of 1 It then multiplies 2 by the value of the Blue Container The value of the Blue Container would then be displayed on the RCX as 2 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 216 TE Use this command to divide the value of a co container by a certain number The default is to Divide divide the Red Container by two User can only Container use integers 1 2 3 Non integer numbers will be rounded to the nearest integer The result also can only be a
8. 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com Lop This command marks the place where your program will jump to when an event is triggered Every event goes to the same land If you are using Event more than one event you will have to use the Landing Event Register Container to determine what event was triggered Example This piece of code sets up a red event that is triggered when the touch sensor is pressed The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the touch sensor is pushed in This will force the program out of the jump sequence and make it land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 136 This command sets up an event to occur when the touch sensor is pressed The default waits for a Set Up touch sensor pressed connected to port one This command must appear before the Begin Monitoring Pressed l evant command in your program You can string in a yellow blue red or generic modifier to have several events You can also string in an
9. Status Example RCs Running and in range TF In Range TE This piece of code displays on the front panel whether the RCX is running and whether it is in range education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 297 EI Use this icon to determine the power setting of T the tower little and big arrows equal high and Read low power mode Most usable in direct mode kowar programming power Example Power This piece of code reads the tower power and displays a true state on the front panel if it is in high state and a false state if it is in low power mode e T a Use this icon to set the IR power of your RCX ia high or low usually done in Administrator Set RCX Can be done in any direct remote local Tower programming mode The Power modifier is a Boolean Power true false control If true is selected the RCX IR power is set to High If false is selected it is set to Low Example This piece of code sets the RCX IR power to High when the program is run education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MIND
10. Use this command when you want to use or monitor the battery value in your program Battery Power is represented as 1000 times the battery power so 654 7654 K Value of Battery Example This piece of code fills the Red Container with the value of the battery and then displays the value on the RCX education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 279 Oo 2 amp Level Level _ Level Level Level String these modifiers to a motor command to control the speed of the motor Speed 1 is the slowest and speed 5 is the fastest Example This piece of code runs motor A forward at power level one until the touch sensor that is connected to Port one is pressed in It then plays a sound and stops motor A education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 280 lt gt Value of Port 1 Value of Port 2 Value of Port 3 Use these modifiers to use the value of ports 1 2 and 3 Example This piece of code fills the Red Container with the value of the light s
11. education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 50 Use this icon to wait for the light reading to become Less than a certain value before moving on to the next command Example This piece of code turns on motor A then waits for the light sensor to read a value less than 30 Then it turns off the motor Use this icon to wait for the light reading to Increase by a certain value before moving to the NXT next command Wait for Brighter Example This piece of code turns on motor A then waits for the light reading to increase by 10 Then it turns off the education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 51 motor Use this icon to wait for the light reading to decrease by a certain value before moving to the NXT Wait next command for Darker Example This piece of code turns on motor A then waits for the light reading to decrease by 10 Then it turns off the motor education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LE
12. 128 a 7 of L La Loop While Sound Loop While Sound Level is Less Than Level is Greater Than Use these to start a loop while the value of the sound level sensor adapter LogIT is less than or greater than some number The loop will stop when the value goes above that number Less Than icon or below Greater Than icon An End of Loop icon is needed somewhere after these icons Example This piece of code will start a loop that plays notes C and D continuously while the value of the sound level sensor adapter is less than 60 dB the default When the reading goes above this the loop will stop education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 129 Fe Fe Lan Lan Loop While Loop While Temperature C is Temperature C is Less Than Greater Than Use these icons to start a loop while the value of the temperature sensor adapter LogIT is less than or greater than some number The loop will stop when the value goes above Less Than icon or below Greater Than icon that number An End of Loop icon is needed Somewhere after these icons Example This piece of code will start a loop that plays notes C and D continuously while the value of the temperature sensor adapter is less than 30 deg
13. 301 ALWAYS start a direct Internet program with this icon Begin Internet Direct Mode Example If an IP number was strung onto the Begin Direct icon this piece of code could control an RCX in direct mode over the Internet It would turn on motor A on the remote RCX until a touch sensor was released and then turn it off ALWAYS end a direct Internet program with this icon Each task needs its own Esnd icon End Internet Direct Mode Example If an IP number were strung onto the Begin Direct icon this piece of code could control an RCX in direct mode over the Internet It would turn on motor A on the remote RCX until a touch sensor was released and then turn it off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 302 Advanced Use this icon when you want to send a program to a specific tower if you have multiple towers on your computer and an RCX is in front of that RCX tower Example This piece of code would send the program to the default port specified Use this icon when you want to initiate the LASM Interface text based program representation before downloading Example This piece of code would Launch the LASM interface with these commands
14. Example This program turns on motors A and C in the forward direction It then initializes light sensor data logging and logs data every 0 1 seconds This continues until 50 data points have been collected then data logging stops Finally the outputs are turned off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 38 This behavior is Position Control It allows for much greater precision in car movement The Position constant and distance can be varied This Control behavior is written for a one motor car In any behavior you can modify the code to fit your needs Example Ea gt ion 10 5 Kej 400 E Nea i JEETS A 5 This program begins by optimizing RCX behavior and resetting the angle sensor The proportionality constant Kp is set up as 10 5 Then a Loop begins in which the value of the angle sensor is placed in the red container and motor A is turned on by a power level that is computed by subtracting the red contained from 32 and multiplying by the proportionality constant Kp After a 0 05 delay the loop is repeated The Loop repeats 400 times and then motor A is turned off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 20
15. Forks Use this fork if you want to take different courses of action based on a touch sensor A fork merge is required at some point after this icon Sensor Fork Example This piece of code would turn on motor A If after 4 seconds the touch sensor is pushed the RCX will play a sound and shut off the motor Otherwise the motor will just be turned off no sound education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 72 l Use this fork if you want to take different kte courses of action based on a touch sensor A fork NXT Touch merse is required at some point after this icon Sensor Fork Example This piece of code would turn on Motor A If after 4 seconds the NXT touch sensor is pushed the RCX will play a sound and shut off the motor Otherwise the motor will just be turned off no sound education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 73 7 z Use this fork if you want to take different NXT courses of action based on volume as read by the Sound NXT sound sensor fork A fo
16. This will display for 2 seconds before the program ends education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 326 This command is used at the start of G Code programs Compute Level 4 amp 5 in which you want View All t manipulate data sets that have already been uploaded to your project Example This piece of code takes data from the Red Bin fits a line to it and puts the plot in the Brown Bin es Use this command to extract the X and Y axis from eet a data set so that you can perform operations on Extract the independent data Example This piece of code extracts the first 0 data set from the blue bin subtracts 10 from the X axis recombines the 2 axes and plots the result in the Yellow Bin education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 327 E es Use this to combine independent axes or arrays a into a graph Combine Example This piece of code extracts the first 0 data set from the blue bin subtracts 10 from the X axis recombines the 2 axes and plots the result i
17. Use this command if you need the RCX to be in view of the tower before moving on Wait for RCX to be in view Example This piece of code waits until the RCX is in view of the tower then reads and displays the value of sensor 1 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 300 a Internet ALWAYS start an Internet program with this icon Internet Begin Example If an IP number was strung onto the Begin icon this piece of code could be sent over the Internet It would be stored as a program in a remote RCX that would turn on motor A until a touch sensor was pressed and then shut it off ALWAYS end an Internet program with this icon Each task needs its own End icon Internet End Example If an IP number was strung onto the Begin icon this piece of code could be sent over the Internet It would be stored as a program in a remote RCX that would turn on motor A until a touch sensor was pressed and then shut it off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com
18. ea In this code motors A and C are set to go in the forward direction Then a loop begins that turns the motors on for one second then off for one second This loop repeats 10 times education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com Snake 30 This behavior is Snake It makes the car turn from side to side a number of times This behavior is written for a two motor car In any behavior you can modify the code to fit your needs Example This code first sets the motors for a power level of 5 the default Then it sets motor A s direction to backward and motor C s direction to forward It then enters a loop which turns the motors on for one second then reverses their directions This loop repeats 10 times education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 31 This behavior is Drive to Bump It makes the F car drive forward until a touch sensor is Drive To pushed This behavior is written for a two Bump motor car In any behavior you can modify the code to fit your needs Example
19. ee ee es 364 4 Customizing ROBOLAB 0 cc cc ee ns 366 4 1 Editing the Default prf file 0 36 7 4 2 Creating your own Sensor Definition Files 372 4 3 Customizing Investigator ee ee ee 378 5 Help amp Idea SOUPCES ccensaGa eee Saaeee er baeneaensuses 384 Appendix education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com Troubleshooting Programming Problems 388 TOS ONG TRICKS 445554546 oe eee ee Gea ee Gees oe ee eons 394 Related Web Sites and Resources eee ee ee 397 ACKNOWLCOSCMECNLS se s224 n45 4455444 h 04 8 bud Sn erat SaN 398 IOE vane cb ee heehee r EGRS SHES CEES EERE E ORES GS BEE ERG ESSE EES 399 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 1 About ROBOLAB ROBOLAB is the software that provides the tools and environment for programming creating learning and exploring with the LEGO RCX and NXT With an intuitive graphical interface students of all ages are able to create autonomous robotic creations collect data
20. wav file Save Sound Example This piece of code initializes the microphone grabs a sound and saves it as a wav file 7 Use this icon to load a sound from a wav file py t Load Sound Example education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 357 This piece of code initializes the microphone loads a sound from the indicated file path and then plays it iF Use this icon to play a sound you have grabbed or Le af saved Play Sound Example This piece of code initializes the microphone loads a sound from the indicated file path and then plays it education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 358 3 How To The sections of this chapter explain how to perform a selection of more advanced ROBOLAB tasks and features ranging from sending Information between 2 RCXs to extracting data to a spreadsheet from Investigator education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial
21. 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 261 Use this to snap an image during a program Example This piece of code waits until the light sensor reading Increases by 5 the default and then it snaps an image Use this icon to fill the mailbox on an RCX with a specific value Can be used in a program or in direct mode Fill Mailbox Example This piece of code fills the mailbox with the value of 5 then starts a loop which turns on Lamp A The loop ends when the RCX receives mail whose value is 4 or less Then the RCX plays a sound and turns off the lamp education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 262 Use this command to clear sounds and reset sound settings This icon can be helpful before events requiring sound input Buffer Example This piece of code would clear the RCX sound buffer Use the Mute Sound icon to put your RCX into Silent mode Mute Sound suppresses all sounds notes or sounds in a running program download sounds except for the sounds made when pressing run stop view and On Off buttons Useful when you want to programmatic
22. ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 112 ye Loop While Timer is Less Than is Greater Than Use these to start a loop while the timer value is less than or greater than a certain number The loop will end when the timer gets to that number Less Than 1con or gets to or below the number Greater Than icon It is helpful to use a zero timer value before this command An End of Loop icon is needed somewhere after each icon Example ann This piece of code zeros the timer then starts a loop that plays the note C and a rest until the time reaches 5 seconds the default education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 113 re Loop While Celsius Loop While Celsius 1s Less Than is Greater Than Use these to start a loop while the temperature is below or above a certain value The loop will end when the temperature rises to or above Less Than icon or drops to or below Greater Than icon that value If the temperature is above that value Less Than icon or below the value Greater Than icon when the program gets to this command it will skip the Loop An End of Loop icon is needed somewhere after each icon Example This piece of code turn
23. BM seeni 343 OUTPUT Assacesriinimecse 264 305 OUTED Dorerin 264 305 OUTPUT nasaun 264 305 OUTPUT Doasnoo e 305 ULPU Eere ENET 305 OCU Fore 305 OED aA ea 305 OULDUT Peene E 305 Be an I oe 331 pH Container pH LoglIT 244 pH Sensor FOU Kags cenzeseecseeesacenee 87 Play Any Note 173 Play OUING ncctseeseseesicteateseacste 18 357 Points Container 236 Position Container Position LoglIT 00 000000 248 Position Control 38 Position Sensor wees 87 POWER LOVE l caccactessacteiapecsqscersetoel 279 Power Level 2s 279 Power Level 3e 279 Power Level 4s 279 Power Level 5 e eee 279 Pressure Container Pressure LoglIT 245 Pressure Sensor nesses 87 Purple Bin eessssesesenssssese 343 OT CUT e 347 Quarter Note eee 175 Kand OMe 281 Random Direction 24 Random Fill Container 233 Random FOP K ccseecdecectdccneesaccsctaccetincs 85 RCX End of Loop Forever 132 RGA LOOD cerere Eanes 131 Read and Display Value 299 Read Battery Power 298 Read BMP seucncisuunissn 332 Read Run Status 296 Read tower pOWwer neeese 297 Read Value eseese 298 REQ essa acateaoseserdentacosacoeeeartens 102 103 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com Red WS W
24. LEGOengineer ing com gH 3 NXT Rotation Sensor Equal Fork 94 Use this fork if you want to take different courses of action based on a rotation sensor A fork merge is required at some point after this icon This piece of code will turn Motor A on at Power Level 10 for 1 second if the value of the rotation sensor is not equal to 720 If it is equal to 720 Motor A will stop for 1 second and a sound will play This code then jumps back to the beginning to begin again education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 95 e Use this fork if you want to take different courses of action based on a light sensor A fork merge is required at some point after NXT ree this icon Light Sensor Equal Fork This piece of code turns on motor A If the Light sensor does not read a value of 55 then the RCX plays a sound After 2 seconds the motor is shut off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com NXT Click Equal Fork 96 Use this fork if you want to take different courses
25. Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com Pixel NXT Clear This command allows you to clear erase a pixel on the NXT display To Locate the pixel you need to give coordinates for its x y position on the NXT display The display s dimensions are 100 by 64 Position 0 0 is in the Lower Left corner of the NXT display To provide the x and y locations right click control click for Mac users on the lower left and right corners and choose create constant or get numeric constants from the modifiers menu Also you can use the value of sensors or containers as coordinates Eee This program will move a dot pixel across the NXT display First it makes the red container equal to 5 Next it enters a loop which draws a pixel on the NXT display with the value of the red container as the X coordinate and 30 as the Y coordinate It waits 0 2 seconds before erasing that pixel Then 2 is added to the red container and the loop repeats In this way the NXT will display a dot pixel moving across the display education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 323 This command allows you to display a bitmap on the NXT display To create the file path to locate the bmp file on yo
26. amp ww LEGQengineer ing com 2939 SoN This command sets the container to an event a State The event states are as follows 0 low TET 1 medium 2 high 3 undefined 4 start Register calibrating 5 calibrating in process Container Example This piece of code where an event was configured earlier takes the current event state puts it in the Red Container and displays it on the RCX s LCD and then beeps This process loops continuously until the event has been triggered education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 240 jhe register of the successful event s of the Event State current task The default is to set the Red Container Container to the register Set the container to a copy of the bit ate Example This piece of code is a part of a Larger program The Event State icon lets the user discover what event was triggered and react accordingly education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 241 This command sets the container to the value of the camera sensor The value
27. ari courses of action based on the number of clicks NXT Click on a touch sensor A fork merge is required at Fork some point after this icon Also a zero clicks sensor command should be used sometime before this icon Example This piece of code first resets the click counter to zero It then turns on Motor A for 10 seconds and will shut it off for two seconds if the click counter has a value of less than 5 If it is greater than five it plays a sound It then jumps back to the beginning and starts again education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineering com ie NXT 78 Use this fork if you want to take different courses of action based on the number of touches and releases on a touch sensor A fork merge is Touch And required at some point after this icon Also a Release zero touch and release sensor command should be Fork used sometime before this icon Example This piece of code turns on Motor A for 4 seconds and if the touch and release sensor reads a value of greater than 10 it will stop the motor If the value is less than 10 it will first play a sound and then stop the motor education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page
28. com 375 200Temp sa in your ROBOLAB gt Engine Sensors folder for an example The effect of this table is to assign a specific value for each of the possible measured values from the sensor If valued valuel023 were all set to 4 for example the sensor would always return the value 4 no matter what value it measured Date of Calibration Specifies the data the calibration was last changed updated manually in mm dd yyyy format Reset Each Time This field specifies whether the sensor is reset education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 376 Using your new sensor definition file in Investigator You can datalog a custom sensor in Program Levels 1 2 and 3 You do this by first selecting the generic sensor icon Select the Generic Sensor icon education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 377 Then you can select your custom sensor adapter from the list of available sensor definition files ah Progamled2 ge Program 1 h INVESTIGATOR C Proftemp LogIT HumiFro LogIT So
29. configured for a variety of different sensors These files provide all the information needed to collect and display data from sensor name and the units measured to calibration equations and tables What makes up a sensor definition file Name ProTemp LogIT Number 200 Units Celsius Resolution 1 Make DCP Types O none 1l switch 2 Temp 3 Reflect 4 Angle 5 IDO 6 IDI1 7 IDZ Modes O raw 1 Boolean 2 Transition 3 Period 4 5 Celsius 6 Fahrenheit 7 Rotations Type 3 Mode 0 Date of Calibration L2 22 1999 Reset Each Time FALSE Calib Type table BeginTable 500000e 2 500000e 2 500000e 2 500000e 2 500000e 2 500000e 2 500000e 2 500000e 2 8 500000e 2 t023 5 500000e 1 EndTable SIAONOBWNEF O PRPPRPPRPHRE ER Date of Calibration 1 28 1999 Reset Each Time FALSE Notes This is for a DCP LogIT ProTemp Temperature sensor Name Specifies the name of the sensor education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 373 Number Gives each sensor a unique number This number is used in upper Level programming to specify the sensor in structure commands wait fors loops etc Resolution Increments the sensor measures in Make Manufacturer of the SENSOR currently
30. events You can also string in an event source source of information such as sensor values of ports 1 2 amp 3 container values or mail values Example This piece of code sets up a blue event that is triggered when the temperature value goes below the threshold in Celsius The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the temperature value goes below the threshold This will force the program out of the jump sequence and make it Land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 143 This command sets up an event to occur when the value of the temperature sensor goes below the Set Up threshold in Fahrenheit The threshold can be Decrease modified with an event modifier The default is a in Temp red event that waits for a temperature reading F Event below 80 F from port one This command must appear before the Begin Monitoring command in your program You can string in a yellow blue red or generic modifier to have several events You can also string in an event source source of information such as sensor values of ports 1 2 amp 3 container values or mail values Example T
31. folder where your sensor is saved you will have to look for All File Types When you have dropped the sensor on the diagram of your program it will look like this Image In values Sensor 0 1 z Image Out Values Mulkidp Select a Vi education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 360 Of the available connections you will need to use Image In Image Out Sensor 0 1 2 and Values The image on which the sensor operation will be performed should be connected to Image In and the processed image is returned in Image Out Values 1S an array of three numbers that contains the result of the vision sensor If your sensor measures either Max Info or Min Info the array will be filled with the three values that represent this result 1 Pixel Intensity 0 255 2 Row number where the maximum or minimum value occurred 3 Column number where the maximum or minimum value occurred If the sensor is of the type that returns only one number pixel sum pixel average blob count etc Sensor 0 1 2 will determine which index of the Values array gets updated with the result Example 1 This program demonstrates how to include a custom vision sensor in an Inventor program The c
32. lego com education robolab and LEGO resources www lego com robotics there are lots of great sites create by ambitious and talented RCX users ROBOLAB CEEO www ceeo tufts edu robolabatceeo This 1s Tufts University s Center For Engineering Educational Outreach s site for all things ROBOLAB including patches beta features activities and other resources Boulette s Robotics in Luxemburg www convict Lu Jeunes RoboticsIntro htm A fabulous site that features high end robotics and ROBOLAB projects with great descriptions and the code used Projects address top LUGNET Lego Users Group Network www lugnet com LUGNET has fabulous LEGO resources ranging from pieces in sets to a wide array of discussion groups on robotics education ROBOLAB and more Mindstorms RCX Sensor Input Page www plazaearth com usr gasperi lego htm Michael Gaperi one of the authors of Extreme Mindstorms An Advanced Guide to Lego Mindstorms has a great web site on sensors and the RCX education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 398 Acknowledgements The ROBOLAB Reference Guide was written compiled and made possible by Martha Cyr Scott McNamara Elissa Milto Merredith Portsmore Erin Cejka Laura Beals and Chris Roge
33. s out Container Example raa G User4 Y U This piece of code fills the blue container also Known as container 1 with the value 10 and fills the User 4 container with the value 1 It then displays the value of the container specified in User 4 User 4 contains the value 1 which indicates the Blue container and the Blue container contains the value 10 hence 10 is displayed for 4 seconds Then the value of User 4 which is 1 is displayed for 4 seconds education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 283 This modifier represents the value of the generic container You can have up to 21 Value of containers Zero 0 is red 1 is yellow 2 is Generic blue and 3 20 are user defined Container Example This piece of code fills the Generic Container with the value of the temperature sensor in Fahrenheit A sound is played and the value of the Generic Container is shown on the RCX If the value of the sensor was 75 degrees the RCX would read 75 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQen
34. you reverse the direction of the motor of change the container multiplier to a negative number You can adjust the sensitivity of the proportional control by adjusting the multiplier education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 35 This behavior is Drive and Sing It makes the car drive forward while playing a song This behavior Drive And 1S written for a two motor car In any behavior Sing you can modify the code to fit your needs Example This program uses a task split so that the car can drive and play a song at the same time The top task turns on motors A and C in the forward direction After 5 seconds it turns the motors off The bottom task plays the red scroll After the red scroll finishes all outputs the default are turned off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 36 ate This behavior is Sing until Dark It causes the ih RCX to repeat a song until the light sensor reading drops below a specified value The code Sing uses an event to monitor for the drop in li
35. 17 a S Es FE Motor A Motor A Forward Reverse Reverse Forward Reverse Use this if you have a motor connected to port A B or C that will be spinning in the forward or reverse direction Use the power level modifier to change how fast the motor spins from 1 slow to 5 fast Without a modifier the power level will be 5 fast Example This piece of code would turn on motor A in the forward direction for one second and then turn it off Use this if you want the lamps connected to port A B or C to turn on Use the power level modifier to change it from bright 5 to dim 1 Without a modifier the power level will be 5 bright Example This piece of code would turn on the lamp connected to port A for one second and then turn it off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com E z past ae m T Dm i Stop A 18 Stop B Stop C Stop all Outputs Use this to stop the motor or Lamp connected to ports A B and C by braking abrupt stop To get a more gradual stop use the float command Example This piece of code would turn on the Lamp connected to port A for one second and then turn it off Use this command to get an audio response from the R
36. 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com Generic Container Example 267 Use this modifier to indicate that you are using values associated with the Generic Container Zero 0 corresponds with the Red Container 1 with the Yellow Container and 2 with the Blue Container Containers 3 20 can be used by string in a numeric constant for the container This piece of code fills the Generic Container with the value of the temperature sensor in Fahrenheit A sound is played and the value of the Generic Container is shown on the RCX If the value of the sensor was 75 degrees the RCX would read 75 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 268 This command takes the value in the container O specified Container and uses that to hoose the container specified This is the Container s l Container ROBOLAB equivalent of a C Pointer Example QE Red Usera ST O This piece of code zeroes both the generic container 3 and the Red Container It then takes the value of the generic container 0 and uses that to determine what con
37. Administrator Pilot or Investigator sections of ROBOLAB a education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineer ing com e rij iil dy glo pepeeppeee pepeeeerriee Begin LGM 1 x1 BeginEnd_Ilb Begin i The Click Begin an Inventor program here for ee more help This is required as the first command in Link every Inventor program When programming in Inventor or higher levels of Investigator context help is also available for each of the icons This help that comes up describes the functionality of the command default settings and the elements of it that can be modified In ROBOLAB 2 5 and higher the Click here for more help Link appears in the Context Help window This brings up extended help Information and a sample program that uses the command that can be opened and downloaded The extended help allows the user to see examples The Using ROBOLAB guide For a more detailed introduction to using the software Step by step directions and more examples and challenges the Using ROBOLAB guide is very useful This PDF is available through your LEGO Education distributor or in electronic pdf format at www legoengineering com Topics in the User s Manual Include
38. Begin Monitoring command in your program You can string in a yellow blue red or generic modifier to have several events You can also string in an event source source of information such as sensor values of ports 1 2 and 3 container values or mail values Example This piece of code sets up a blue event that is triggered when the value of the light sensor goes above 10 the light threshold The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the value of the light sensor goes above 10 This will force the program out of the jump sequence and make it land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineering com 158 Ey This command sets up an event to occur when the r NXT S Up Da Event value of the NXT light sensor goes below the threshold The threshold can be modified with an event modifier The default is a red event that et waits for a light equal to or below 55 from port rk one This command must appear before the Begin Monitoring command in your program You can string in a yellow blue red or generic modifier to have several events You can also string in an event source source of information
39. Container LOO E TO eee een ene ieee ee 185 Initialize Fast Timer LORS ITE srece 187 Initialize Generic Sensor LOSE TE eienenn 191 Initialize Humipro Sensor LOS O TIE ea N 192 Initialize Light Sensor Logging 176 Initialize Mail Logging 186 Initialize pH Sensor LOCETNE sonra 192 Initialize Position Sensor LOOO TINE ee ee 194 Initialize Pressure Sensor LOSE T O ea 193 Initialize proTemp Sensor OS SN cercen 194 Initialize Rotation Sensor EOS E TI E e ee 179 Initialize Sound Sensor LOCO TNE eeen 193 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com Initialize Temperature Sensor LOZgZin 178 Initialize Timer Logging 187 Initialize Touch and Release Sensor Logging 180 Initialize Touch Sensor LOZE TNE sericea 177 Initialize Voltmeter Sensor LOCE TO iee eE 195 Taput eaen 265 306 INDUL Zacr ae 265 306 LADUT Sieen 265 306 INDUT 4 ercrrmenannsenrades 306 311 EDDU Seeria 306 IDDPUT Gire 306 IDUL See 306 LDU T O aaa ri 306 INTEST A CC xc cccsceinccesncscatasatssacanazeces 335 EDCEFICE oeae 300 nvestigator cc ceeececceceeeeeeeeseeeeeeeees 176 Ts RCX in view nasses 295 JUMPIN E eea rE 103 POS on n E 102 2 11 o rear ni trier tere nen cee tyre terrae 20 LANDY Aeaee 17 LMI
40. Example This piece of code initializes a small image allows the user to adjust camera options takes a color image and saves it as a bmp file Use this to grab a red image Grab Red Example This piece of code initializes a medium image snaps a red image and converts that image to a picture to be displayed education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineering com 348 on the control panel Use this to grab a green image Lal Grab Green Example This piece of code initializes an Internet image takes a green image from a remote camera and converts it to an array which is displayed as an intensity graph on the front panel Ti Use this to grab a blue image Grab Blue Example This piece of code initializes a medium image takes a blue image and shrinks it to a small image education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineering com 349 Use this to grab an image in grayscale Liza Grab Grey Example This piece of code takes a small gray image and then determines the value of the
41. Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 220 Use this command to fill a container with the value of the temperature Fahrenheit sensor The default is to set the Red Container to the value eka of the temperature sensor on port 1 In your program be sure to specify what port your temperature sensor 1S connected to with a modifier Rounds value to nearest integer value 70 7 goes to 1 Example This piece of code fills the Generic Container with the value of the Temperature sensor in Fahrenheit A sound 1s played and the value of the Generic Container is shown on the RCX If the value of the sensor was 75 deg the RCX would read 5 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 221 ta Use this command to fill a container with the o value of the rotation sensor The default is to Angle set the Red Container to the value of the Container rotation sensor on port 1 In your program be sure to specify what port your rotation sensor is connected to with a modifier Example This piece of code fills the Red Container with the value of the Rotation sensor A sound is played and the value
42. Investigator into an external file When a program 1s run containing Saye this command you will be prompted to specify a Data name and location for the file you wish to save This can be useful if you want to transfer data from one Investigator project to another export the data from one project and load it into another Example This piece of code takes data from the Red Bin averages the Line and then saves the result to a file specified by the user education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 343 Lavender Bin Brown Bin Purple Bin Orange Bin Use the bins to organize and retrieve data Bins can contain multiple plots It is best to use one bin per type of data you are collecting Use the Red Bin for light data the Blue Bin for temperature data etc Example This piece of code takes data from the Red Bin fits a line to it and puts the plot in the Brown Bin Example This piece of code extracts the first 0 data set from the blue bin subtracts 10 from the X axis recombines the 2 axes and plots the result in the Yellow Bin education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopie
43. LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com NXT Initialize Light Sensor ON r reroute 180 NXT Initialize Sound Sensor LOSE IIE saeni 182 NXT Initialize Touch And Release Sensor Logging 185 NXT Initialize Touch Sensor LORE TINE eE 181 NXT Light Container 221 NXT Light Sensor Fork 76 NXT Loop While Touch Sensor 15 Let Oi ari cseeesecnteeesee 107 NXT Loop While Touch Sensor is Pushed 106 NXT Motor Angle Container E ENE 231 NXT Rotation Sensor Fork 75 NXT Set Up CLICKS 155 NXT Set Up Dark Event 158 NXT Set Up Decrease In Distance Event 162 NXT Set Up Decrease In Volume Event 160 NXT Set Up Increase In Distance Event 161 NXT Set Up Increase In Volume Event 159 NXT Set Up Light Event 157 NXT Set up Pressed Event 153 NXT Set Up Release Event 156 NXT Set Up Released Event P E E 154 NXT Sound Container 230 NXT TOUC h eeessssenssssesserseese 72 NXT Touch Container 229 PIE cll i of E E anne te 320 NXT Zero Angle eee 210 NXT Zero Clicks Sensor 205 NXT Zero Distance Sensor 208 NXT Zero Light Sensor 207 NXT Zero Sound Sensor 209 NXT Zero Touch And 00 206 NXT Zero Touch Sensor 204 Olive gt 8 6 eee ee or 343 OR Container 213 Orange
44. LEGOengineering com 121 ie ie Container Value Container Value Is Equal To Is Not Equal To Use this to start a loop while the value of a container 1s equal to or not equal to a number An End of Loop icon is needed somewhere after each icon Example This piece of code fills the red container with the number 10 The Loop runs plays a sound while the red container is not equal to zero If the touch sensor is pressed the red container is set to zero and the loop stops running education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 122 Loop Use in Investigator Use this to start a loop While while the number of data points is less than Paints in some number The loop will end when the number Data Set of data points gets to or goes above that are Less number An End of Loop icon is needed Than somewhere after this Example This piece of code begins logging light sensor points and enters a loop Inside the loop it adds a time stamp to the data set and waits for 10 more points This continues until there are 150 points or more then the data logging stops education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commer
45. RCX says the temperature sensor is 60 nothing happens Sample Problem Code This program does not work because the temperature sensor data is being put into the red container but the program is waiting for the Yellow Container to equal 55 or greater Container commands default to the Red Container if no other color container is denoted Changing the temperature container to yellow or using the Red Container for the Wait for Container will allow the program to run Solution education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 392 I programmed my car to drive for 4 seconds stop for 2 seconds and then repeat indefinitely but nothing happens Sample Problem Code The jump and land icons are in the wrong positions The land icon should be first The first thing that happens in this program is that the Jump icon tells the program to go directly to the Land icon This means that the rest of the program is bypassed and thus the car never moves Solution education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQen
46. ROBOLAB officially supports sensors made by LEGO and DCP Micro However the RCX and ROBOLAB are capable of supporting any sensor that requires 5v power Types This item simply lists the different kinds of sensors that can be specified in the Type field none switch Un powered measurement Temp Reflect Powered 5v measurement Angle IDO ID1 ID2 NID BWN EF Modes This simply lists the different modes in which a sensor may operate This value is specified in the Mode field O raw Sensor operates on the full scale of the 10 bit A D and will return values from 0 1023 for custom sensors Boolean Sensor returns only 1 or LEGO touch sensor Transition Sensor returns 1 or based on whether a transition between high and low has occurred LEGO touch and release sensor Period Sensor return value is a percentage of the total range of the 10 bit A D 0 100 5 Celsius Sensor return value is the total range converted to a Celsius measurement education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com N e A Ww 374 6 Fahrenheit Sensor return value is the total range converted to a Celsius measurement 7 Rotations Sensor value is the total range converted Into
47. Remote Container 258 FERE ee Wall cesicaesgeber ostetacectiesatasd 226 FIC CUT Veee 333 Fit Exponential ee 334 FIE ETNE cererea en ne a tee 332 FIC Lie R 339 PIE SPLINE ern ee 340 Flip Direction 19 Float Outputs oe 19 Force An Event 149 Fork Merge neeese 86 Formula Container 238 Forwarfd ssessesssessesssrssrsssrsersses 23 Free SampLling eee 217 Free Sampling with Time Sai eee eee een eee ee 276 Frequency Analysis 355 Generate LASM command 303 Generic Container 267 Generic Event 287 Generic Sensor Container 242 Generic Sensor Fork 0 86 Get Image Subset 353 Get Pixel Value 351 G Strale eee eee 28 orab BTU eee nee ri 348 Grab Green neesssssesseerrreresssssssss 348 Grab Gi CY was ccosssneiccrcvesvannesiwivzacceses 349 Grab ROG wchccctscnceciatictasttaastense 347 Grab RGB srsorerarmensnnrninense 347 Grab SOUnNd aeriurisiiririnesisirensissi 355 Grab Sound Continuously 355 Green BU iicortesscanssencteceaessvavessseeenes 343 Green DUNS oeccrrsncirsiscsrcrms 102 Green Land qu ceseseeeseeees 103 Half Note eee 175 MISCO at penne ere terete reenent 334 Humidity Container HumiPro LOCI aare E 243 Humidity Sensor Fork 87 Init Internet Image 346 Init Large Image 0 345 Ine MIC ne mr 354 Init Small Image 345 Initialize Click Sensor 179 Initialize Clock 186 Initialize
48. The Pilot and Inventor levels of programming in the PROGRAMMER component of ROBOLAB This is all one needs to program a LEGO robot education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineer ing com The INVESTIGATOR component that is used for data logging This section adds scientific investigation to the robot s capabilities allowing the RCX to become a Smart and mobile data logging tool The Investigator component also includes a Journal Area for documenting a project in text and photographs or illustrations and a Publish feature for sharing results The enhanced Media features the Piano Player and Camera available in ROBOLAB 2 5 1 and higher The manual also Shows how to use some of the higher Level capabilities Including Vision Center and subroutines education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com ROBOLAB Web Sites ROBOLAB has a growing web based community that has Information ideas and examples of users in action Two web sites that have Learning resources developer Information and SDKs new downloads more docum
49. This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com L9 This command sets up an event to occur when the value of the light sensor goes below the threshold The threshold can be modified with an event modifier The default is a red event that waits for a light equal to or below 55 from port one This command must appear before the Begin Monitoring command in your program You can string in a yellow blue red or generic modifier to have several events You can also string in an event source source of information such as sensor values of ports 1 2 amp 3 container values or mail values Example This piece of code sets up a blue event that is triggered when the light value goes below the threshold The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the light value goes below the threshold This will force the program out of the jump sequence and make it land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 140 This command sets up an event to occur when the value of the temperature sensor goes above the Se
50. This will force the program out of the jump sequence and make it land where the event landing is located Motor A will then go forward for 2 seconds and then stop education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 161 This command sets up an event to occur when the value of the NXT distance sensor goes above the threshold The threshold can be modified with an event modifier The default is a red event that NXT Set waits for a distance reading higher than 16 from Up port one This command must appear before the Increase Begin Monitoring command in your program You can In Dista Event string in a yellow blue red or generic nce modifier to have several events You can also String in an event source source of Information such as sensor values of ports 1 2 and 3 container values or mail values Example This piece of code sets up a red event that is triggered when the value of the distance sensor goes above 15 the distance threshold The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the value of the distance sensor goes above 15 This will force the program out of the jump sequence and make it land where the event Landing is L
51. Use this fork if you want to take different shiner courses of action based on the value of a generic eanoric sensor adapter A fork merge is required at some Sensor point after this icon Fork Example This piece of code would play a sound if the value of the generic sensor adapter was less than or equal to 2 volts the default education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 87 Humidity pH Sensor Pressure Sound Level Sensor Fork Fork Sensor Fork Ee Temperature Position Vol Sensor Fork tage Fork Sensor Fork Sensor Fork Use this fork if you want to take different courses of action based on the value of a LogIT sensor A fork merge is required at some point after this icon Example This piece of code would play a sound if the value of the humidity sensor was less than or equal to 50 the default education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 88 Use this fork if you want to take different ee courses of action based on a temperature sensor EE A fork merge
52. a Rotations measurement 16 per revolution Type Define the sensor type e g Type 1 Mode Define the sensor mode e g Mode 0 Calib Type This field specifies the type of calibration used to convert the measured data into the required units The two options are Curve applies a linearly interpolating equation to the measured data and Table applies a Lookup table you specify to the measured data Calibration This allows you to specify the Line equation if Calib Type is Curve or the Lookup table if Calib Type is Table If you are using the Curve type specify the Calibration field as follows Calibration a0 alXt numberl number 2 Where numberl is the y intercept or b from mx b and number2 is the slope or m from mxt b These two numbers Should be separated by a tab If you are using the Table type specify the Calibration field as follows Beginlable 0 valued 1 valuel 2 value2 1022 value1022 1023 value1023 EndTable Where 0 1 2 1022 1023 are the measured data and valued valuel value1022 value1023 are the values of the lookup table Each number value pair should be separated by a tab and each line should be separated by two tabs see education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing
53. above 40 the sound threshold The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the value of the light sensor goes above 40 This will force the program out of the jump sequence and make it Land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 160 This command sets up an event to occur when the value of the NXT sound sensor goes below the threshold The threshold can be modified with an event modifier The default 1s a red event that waits for a sound equal to or below 55 from port a set one This command must appear before the Begin p Monitoring command in your program You can Decrease l Iin Vol string in a yellow blue red or generic a ume modifier to have several events You can also string in an event source source of information such as sensor values of ports 1 2 and 3 container values or mail values This piece of code sets up a red event that is triggered when the value of the light sensor goes below 40 the sound threshold The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the value of the light sensor goes below 40
54. amp ww LEGQengineer ing com Value of Red Timer 001 Value of Red Upper Threshold 289 Value Of Variable Modifier Value of Yellow Data Set 286 Value of Yellow Duration 292 Value of Yellow Event 288 Value of Yellow Hysteresis dee Beenie ENE LE 291 Value of Yellow Lower Threshold 290 Value of Yellow Timer 284 Value of Yellow Upper Threshold 289 V r gt 0 ik lt n i 270 View Allees 326 Vision Sensors cseceecesceeceeceecees 359 Voltage Container Voltmeter LogIT 0000 249 Voltage FOrk eee 87 Wait for Decreasing H 64 Wait for 10 Points 000000 42 Wait for 100 Points 42 Wait for 500 Points 42 Wait for Angle 47 Wait for brighter 45 Wait for CLOCK ee 60 Wait for Container eee 59 Wait for Dark 45 Wait for Darker 46 Wait for decrease in Camera SENSOT pects sae eet ete coe 62 Wait for Decrease in Temperature C n se 66 Wait for Decrease in VOLTO E opt cecttetecesantarecepenneteeeee 66 Wait for Decrease in Voltage Generic 63 Wait for Decreasing HUMI OT UY seeoniscnirserarenedie 63 Wait for Decreasing pH 64 Wait for Decreasing PreSSUT E eereirreiinni nnna 65 Wait for Decreasing Sound LEVE l gretciauiocieterettanieustnceeuieiss 65 Wait for Decreasing Temp 0G E EE O E 58 Wait for Decreasing Temp OF EE E 58 Wait for increase in Camera OUTS Ole e 62 Wait for Increase in VOLTA 2 lt n en ee
55. and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 163 This command sets up an event to occur when the ae value of the rotation sensor goes below the Sat Up threshold The threshold can be modified with Decrease an event modifier The default is a red event iin that waits for a rotation reading equal to or Rotation below 16 rotation sensor is in 16ths of a evant rotation from port one This command must appear before the Begin Monitoring command in your program You can string ina yellow blue red or generic modifier to have several events You can also string in an event source source of information such as sensor values of ports 1 2 amp 3 container values or mail values Example This piece of code sets up a yellow event that is triggered when the rotation value goes below the threshold The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the rotation value goes below the threshold This will force the program out of the jump sequence and make it land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rig
56. and the value of the Red Container is shown on the RCX If the value of the position sensor was 8 the RCX would read 8 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 249 t Use this command to fill a container with the CA value of the voltage sensor adapter The Voltage default is to set the Red Container to the value of the voltage sensor adapter on port 1 Container l In your program be sure to specify what port Voltmeter LogIT your voltage sensor adapter is connected to with a modifier Example This piece of code fills the Red Container with the value of the voltage sensor A sound is played and the value of the Red Container is shown on the RCX If the value of the voltage sensor was 8 the RCX would read 8 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 250 Use this command to fill a container with the value of the acceleration sensor The Acceleration default is to set the Red Container to the Sensor value of the acceleration sensor on port 1 Container In your program b
57. before moving on to the next NXT command Wait for Push Example This piece of code waits until the NXT touch sensor on Port 1 is pressed in which case Motors A and C go forward until the touch sensor is pressed again When it 1s pressed Motor A will continue forward and Motor C will go backward for 2 seconds then both motors will stop wy Use this icon to wait for something to release the new NXT touch sensor before moving on to the NXT next command If the touch sensor is not pressed Wait to begin with the touch sensor must be pressed For then released Let Go Example education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 49 This piece of code waits until the NXT touch sensor on Port 1 is pressed While it is pressed Motors A and C go forward until the touch sensor is released When it is released Motor A will continue forward and Motor C will go backward for 2 seconds then both motors will stop Use this icon to wait for the light reading to NXT become greater than a certain value before Wait moving on to the next command for Light Example This piece of code turns on Motor A then waits for the light sensor on Port 1 to read a value greater than 36 Then it turns off the motor
58. compose music and snap pictures The RCX amp NXT The Programmable LEGO Bricks Low Entry High Ceiling LEGO elements can be a powerful teaching tool for students of all ages Using LEGO bricks a kindergarten student can explore the concept of numbers and sorting Adda few motors and sensors to those LEGO bricks and a college Student can learn about engineering and physics by building a robot or a set up to measure spring constants Having Students from 5 25 use the same toolset to learn allows more time to be focused on learning and exploring and less on learning how to use software na education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineer ing com 10 ROBOLAB and LabVIEW ROBOLAB is built on top of a robust piece of software called LabVIEW LabVIEW is a powerful programming environment used by engineers and scientists in colleges and industry It is the leading software development tool for measurement and control Created by National Instruments Texas US in 1997 LabVIEW is used to analyze and compute real results for biomedical aerospace energy research applications and numerous other applications NASA for example monitored the Mars Sojourner Rover s location and position in relation to the landing craft its orient
59. cutoff NXT before moving onto the next command Wait for Loud Example This piece of code turns on Motors A and C then waits for education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 54 the sound sensor to notice a volume greater than 70 in which case Motors A and C reverse It then waits for the sound sensor to read a value less than 35 Next it jumps back to the beginning of the program and starts again Use this icon to wait for the sound sensor to notice a volume less than the specified cutoff NXT before moving onto the next command Wait for Quiet Example This piece of code turns on Motors A and C then waits for the sound sensor to notice a volume greater than 70 in which case Motors A and C reverse It then waits for the sound sensor to read a value less than 35 Next it jumps back to the beginning of the program and starts again education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 55 Use this icon to wait for the volume to increase NXT by the cutoff value before moving o
60. get data that looks something like ge percent 23 0 l l l l l l l l l l O00 1 00 200 300 400 500 600 FOO 800 5400 10 00 Time sec You can then use a spectral analysis to determine the natural frequency find the peak and then use a little math to calculate and display g the gravitational acceleration Your final panel and diagram might Look like the figure below You can cut and paste pictures onto the panel LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 381 Natural Frequency Hz fr on INVESTIGATOR Length Creu y estimate of g Lms is 927 Length rr Get Fed Bin First Flot Get the x value freq Length n in red bin Ifor the peak vy yalue The only real disadvantage of this method is that when the user leaves the page and returns to it you get the picture Compute 4 below and the user has to click on the button to get the education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation
61. in Temp F ENVOIE seen a hipiieactenseccectaseescoes 143 Set Up Enter Hi Event 147 Set Up Enter Low Event 145 Set Up Enter Normal Event E A EE EEE 146 Set Up Increase in Container Event 0 164 Set Up Increase in Rotation ENVOIE eer E 152 Set Up Increase in Temp C EAEE a ene ere EES 140 Set Up Increase in Temp F EA SU E E E ees 141 Set Up Increase in Timer AY 0 E 168 Set Up Light Event 138 Set Up Mail Event 144 Set Up Pressed Event 136 Set Up Released Event 137 Set Up Touch and Release WCU Gia eeces th eotensatesea a ece renee 151 Shrink Image eee 350 Sign Container 214 8 I E E 36 Sixteenth Note 175 SKIPS OVER saiat casceeatavcarsataoiceaneseatacts 389 IS N 30 Snap Image ooe 261 Sound Level Container Sound LOS LT oeeo a 246 Sound Level Sensor Fork 87 SCC GI UM eressero a 340 Standard Deviation 338 Start Data Logging 189 Start Data Logging with CCS oe tee eae aet 189 Start Direct RCX Communi cation cccee 258 Start Monitoring for an OU Gest eee cease 133 Start Of LOOD see peace steences 123 Start Remote Program 259 Start Subroutine 69 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQ
62. is required at some point after this Equal icon Fork Example This piece of code waits one second and reads the temperature If the temperature is not 30 degrees Celsius the default it will play a sound Use this fork if you want to take different courses of action based on the value of a container A fork merge is required at some point after this icon Equal Fork Example This piece of code fills a container with a random number If that number is not equal to 1 the default the RCX plays a sound education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 89 Use this fork if you want to take different courses of action based on the value of a timer A fork merge 1s required at some point after this icon Reminder Comparison value is measured in tenths of seconds This piece of code turns on Lamp A for a random amount of time and then turns it off If the time is not equal to 5 seconds the default the RCX plays a sound Use this fork if you want to take different atl courses of action based on a light sensor A fork Light merge 1s required at some point after this icon Sensor Equal Fork Example This piece of code turns on motor A If the Light sensor does not read a value of
63. like the letter C This will display for 2 seconds before the program ends education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 319 This command allows you to draw a line on the NXT display To locate the line you need to give coordinates for the x y position of its start and end point The display s dimensions are 100 by 64 Position 0 0 is in the lower left corner NXT Draw of the NXT display To provide the x and y Line locations right click control click for Mac users on the lower left and right corners and choose create constant or get numeric constants from the modifiers menu Also you can use the value of sensors or containers as coordinates Example This program will draw a diagonal line across the NXT display First clears the NXT display Then it draws a line from 1 1 to 99 60 In this way the NXT will display a line from the lower left corner to the upper right of the NXT display This will display for 2 seconds before the program ends education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOeng
64. may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 79 Use this fork if you want to take different courses of action based on a temperature sensor A fork merge 1s required at some point after this icon Celsius Fork Example This piece of code waits one second and reads the temperature If the temperature is 30 degrees Celsius or less it will play a sound Use this fork if you want to take different courses of action based on the value of a container A fork merge is required at some point after this icon Container Fork Example This piece of code fills a container with a random number If that number is less than the number specified by the compare to control the RCX plays a sound education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 80 Use this fork if you want to take different courses of action based on the value of a timer A fork merge is required at some point after this icon This piece of code turns on lamp A for a random amount of time and then turns it off If the time is less than 3 seconds the RCX plays a sound education LEGO the LEGO logo and MINDSTORMS are trademar
65. motor A on waits 4 seconds and turns it off The value of the rotation sensor is placed in a variable container called rotations This container is divided by 4 and its value displayed on the NXT followed by rot sec This will be displayed for 2 seconds before the program ends education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 271 This modifier allows you to access the value of a container where a variable is stored Type name the variable name in the string constant Value Of Variable Modifier Example iS ae This code zeros the NXT rotation sensor on Motor A then turns motor A on waits 4 seconds and turns it off The value of the rotation sensor is placed in a variable container called rotations This container is divided by 4 and its value displayed on the NXT followed by rot sec This will be displayed for 2 seconds before the program ends education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 272 Q Q Q Red Timer Blue Timer Yellow Timer Use this modifier to indicate that you are u
66. needed somewhere after this icon This piece of code starts a loop that would continuously run Motor A while the rotation sensor value was 720 or less When the rotation value is greater than 720 Motor A stops for 2 seconds then Motor A runs in reverse for 2 seconds Next Motor A stops for 4 seconds before jumping back to the beginning to start again education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 120 a e Loop While Camera Loop While Camera Sensor is Less Sensor is Greater Than Than Use this to start a loop while the value of the camera container is less than or greater than some number The loop will end when the container goes above Less Than icon or below Greater Than icon that number An End of Loop icon is needed somewhere after each icon Example This piece of code starts a loop while the camera container value is less than 1 the default It turns on motor A When the container value is greater than 1 the loop stops and turns off motor A education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww
67. never stop running Sample Problem Code A common mistake in Inventor level programming is to write programs similar to the one above The program above will turn motors A and B on wait for 6 seconds and then the program will Stop running However the motors will continue to run and run Inventor level programming requires that you explicitly stop the motors as in the program below Solution education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 389 I programmed my car to do X but it seems like it skips over that part Sample Problem Code A simple programming challenge would be to program a car to drive forward for 4 seconds beep and then back up The above program is an attempt at solving that challenge assuming you have a car with motors on ports A amp C However there is a problem the car will never back up Why Immediately after the motors are set to run in reverse the program loops to the beginning of the program and sets the motors to run forward The process happens so quickly within 100ths of a second that the car will never back up you may hear the motors click The solution is to add a Wait For Statement after you have set the motors in reverse Solution education LEGO
68. of the Red Container is shown on the RCX If the value of the sensor was 8 the RCX would read 8 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 222 ta Use this command to fill a container with the G value of the mailbox The default is to set the Mail Red Container to the value of the mailbox Container Example This piece of code fills the Red Container with the value of the mailbox A sound is played and the value of the Red Container is shown on the RCX If the value of the mail was 2 the RCX would read 2 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 223 Use this command to fill a container with the value of the timer The default is to set the Tamer Red Container to the value of the red timer Value You can use modifiers to determine what Container container you re using as well as what timer value you re using Example This piece of code fills the Red Container with the value of the timer A sound is played and the value of the Red Container is shown on the RCX If the value of t
69. of action based on the number of clicks on a touch sensor A fork merge is required at some point after this icon Example This piece of code will turn Motor A on at Power Level 10 for 1 second if the value of the click count sensor is not equal to 10 If it 1s equal to 10 Motor A will stop for 1 second a sound will played and the click sensor will be reset to zero This code then jumps back to the beginning to begin again education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 97 Use this fork if you want to take different courses of action based on the number of touches NXT and releases on a touch sensor A fork merge is Touch required at some point after this icon And Release Equal Fork Example This piece of code will turn Motor A on for 1 second if the value of the touch and release sensor is not equal to 10 If it 1s equal to 10 Motor A will stop for 1 second a sound will played and the touch and release sensor will be reset to zero This code then jumps back to the beginning to begin again education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww
70. of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 115 re Loop While Loop While Fahrenheit is Less Fahrenheit is Than Greater Than Use these to start a loop while the temperature is below or above a certain value The Loop for the Less Than icon will end when the temperature rises to or above that value The Loop for the Greater Than icon will end when the temperature drops to or below that value If the temperature is above that value with the Less Than icon or below the value for the Greater Than icon when the program gets to this command it will skip the loop An End of Loop icon is needed somewhere after each icon Example This piece of code turns on motor A in the forward direction then starts a loop which continuously flips the direction of the motor and waits one second until the temperature gets to or goes above 80 degrees Fahrenheit When this happens motor A is shut off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 116 Loop While Clock Loop While Clock Value is Less Than Value is Greater Than Use these to start a loop while the RCX cloc
71. of the NXT Light sensor on port 1 and places it in the red container The value of the NXT rotation sensor on motor A is placed in the blue container and the value of the distance sensor on port 3 in the yellow container These values are then displayed on row 2 on the NXT display education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com This command allows you to erase a rectangle on the NXT display To Locate the rectangle you need to give coordinates for the x y position of two of its corners The display s dimensions are 100 by 64 Position 0 0 is in the lower NXT Erase left corner of the NXT display To provide the Rectangle x and y locations right click control click for Mac users on the Lower left and right corners and choose create constant or get numeric constants from the modifiers menu Also you can use the value of sensors or containers as coordinates ect Example This program will draw a rectangle on the NXT display and then erase half of it First clears the NXT display Then it draws a rectangle that from 10 10 to 80 50 After 2 seconds it will erase a rectangle from 40 1 to 80 50 Then the NXT will be displaying the Left half of the rectangle it will look like the letter C
72. pages and a downloadable version of their project Published projects are stored in folders in the A ML project folders are named with the original project and the date the web pages were created Songs ROBOLAB 2 5 and higher The songs and sounds shipped with ROBOLAB as well as user created songs generated from Piano Player are stored with in the Song folder The subfolders Classical SoundFX and Misc contain the music and sounds shipped with ROBOLAB Users should save the songs they create to the subfolder My Songs Songs saved in the My Songs folder appear in the Pilot pull down menu of song choices education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 365 Vision ROBOLAB 2 5 and higher The Vision folder contains two subfolders Pictures and Video Sensors The Pictures subfolder contains any images acquired by using the snap or grab pictures buttons or commands in Pilot Vision Center or the corresponding Inventor icon The Video Sensors subfolder contains the default Video Sensors that ROBOLAB ships with that are used in Vision Center Any user created Video Sensors should also be saved in this folder so that they can be used in Vision Center Path to User Data As ROBOLAB has evolved the method and structure of s
73. program using the encoders rotation sensors built in to the NXT NXT Zero motors Angle Sensor Example This piece of code resets the NXT angle sensor on motor A Motors A and C turn on until the angle sensor reads 30 Then the motors turn off LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 211 Allows you to programmatically configure the type mode and slope of the Generic Sensor settings of which are specified in e 101Generic sa sensor file Calibrations must be altered in the actual sensor file Sensor Example a This piece of code sets up a sensor with as type None mode Raw with a slope of 2 It waits for the value to read below 3 and then beeps Allows you to reset the sensor ports so you can use two different sensors on the same port Note This should be used carefully by advanced users Reset and can only be implemented with compatible sensor sensors Ports Example This piece of code waits for the touch sensor to be pressed and the resets the sensor ports waits for one second and then beeps until the light value is greater than 50 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocop
74. read above 30 degrees Celsius the default After that it plays a sound and turns off the Lamp education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 59 Use this icon to wait for the value of a container to be equal to some number before Wait or moving on to the next command Container Example This piece of code empties the red default container Then it turns on motor A It waits for the container value to equal 1 the default and when it does it turns off motor A and stops all tasks At the same time a second task is filling the container with the value of the touch sensor In essence this program waits for the touch sensor to be pressed and then turns off the motor Use this icon to wait for mail before moving on Ast to the next command Wait for Mail Example This piece of code turns on motor A and waits to receive mail Once the mail is received it turns off motor A education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineer ing com 60 Use this icon to wait for the clock on the RCX to
75. reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 232 This VI allows you to evaluate formulas This command allows floating point math You can aiae declare floating point variables using this command Expression Example i f a mS aN 2 2 fama a i a cock rd alse rate rate rotations 4 This code zeros the rotation sensor on port 1 then it runs motor A forward for 4 seconds and turns off the motor The value of the rotation sensor on port 1 in a container that is named rotations Then the rate is computed by dividing the rotations by 4 the number of seconds the motor ran Next the rate 1s place in the red container Finally this value is displayed on the RCX education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 233 e Use this command to fill the container with a a oe atl random value between zero and a max random Random number determined by a modifier The default Fill 1s to fill the Red Container with a random Container number between and 8 Example This piece of code fills the Red Container with a random number from to 8 A sound is played and the value of the Red Container is shown on the RCX If the value of the sensor was 8 the RCX wou
76. the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 18 7 This initializes logging of the regular timer timer that increases in 1 second increments imi alize a the Sone which increases in 01 Timer second increments Logging Example This piece of code initializes the red default timer to zero initializes regular timer logging starts data logging every 1 seconds logs for 4 seconds and then stops data logging This initializes logging of the fast timer timer that increases in 01 second Tere increments versus the regular timer that Fast Timer Increases in 1 second increments Logging Example This piece of code initializes the red default timer to zero initializes fast timer logging starts data logging every 1 seconds logs for 4 seconds and then stops data logging education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 188 Use this command to collect data from the Camera sensor Initialize Camera Sensor Logging Example This piece of code would take 10 data points from t
77. the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 390 I programmed my motors to stop running after the touch sensor is pressed but the motors keep running even after I press the touch sensor Sample Problem Code Often times programming problems are the result of how you have built your robotic creation In the above program there 1s no modifier wired into the Wait For Touch icon therefore it defaults to waiting for a touch sensor to be pressed on Port 1 However if in your creation you have the touch sensor plugged Into Port 2 no matter how much you press it your motors will never be triggered to stop running The programming solution to this problem is to specify the port which your touch sensor 1s plugged into if your model allowed you could also physically Switch which port your touch sensor was plugged into Solution education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 391 Motor A should turn on when the yellow container being filled by the temperature sensor has a value of 55 or greater but even when the
78. the information received from the vision sensor to a container on the RCX This example uses Direct Mode to continually update the Red Container on the RCX It also refreshes the image once per loop and applies the vision sensor to the new image See Vision Center and Direct Mode sections for more Information on creating vision sensors and communicating with the RCX education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineer ing com 363 3 2 Containers in ROBOLAB There are 4 7 available containers variables on board the RCX The following table outlines how they are generally allocated in ROBOLAB It is recommended that most users only utilize 22 for programs Addressing containers above 22 can result in conflicts and execution problems Only advanced users should work directly with variables above 22 Red Container gt O Generic User Containers 23 25 Data Pad Red Blue Yellow Values last value logged 26 28 Data Pad Red Blue Yellow Counts number of points acquired 47 Wait for brightness or darkness 47 Play System Sound 46 47 Wait for Angle 33 47 For Loop iterations Accessible through the Loop Counter Container Modifier e Variables above 22 cannot currently be directly disp
79. the red event to be a normal event with an upper threshold of 60 a lower threshold of 40 duration of 10 seconds and hysteresis of 2 The program will beep repeatedly until the sensor on channel 1 fulfills the event requirements It will then display the value of the red hysteresis on the RCX LCD for 4 seconds education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 292 Q Value of Value of Value of Value of Red Blue Yellow Generic Duration Duration Duration Duration Use these modifiers to represent the value of the duration of the Red Blue Yellow or Generic Event Ss hea Example fA This piece of code sets the red event to be a normal event with an upper threshold of 60 a Lower threshold of 40 duration of 10 seconds and hysteresis of 2 The program will beep repeatedly until the sensor on channel 1 fulfills the event requirements It will then display the value of the red duration on the RCX LCD for 4 seconds education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 293 The loop iterati
80. this if you want to wait a certain number of minutes before moving on to the next command Wait for Useful to choose duration of motor and lamp activity Time min Example This piece of code would turn on motor A for the number of minutes specified on the control panel and then turn it off H H H fo ico gt Wait for 10 Wait for 100 Wait for 500 Points Points Points Most useful in Investigator Use these icons when you want to collect the specified number of data points before moving on to the next command Example This piece of code clears the data memory then logs 500 points of rotation sensor data education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 43 a Most useful in Investigator Use this icon when you want to collect a certain number of data Wait for points before moving on to the next command N Points Example This piece of code would take 50 data points from the mailbox Use this icon to wait for something to push in the touch sensor before moving on to the next Wari for command Example If an IP number was strung onto the Begin icon this piece of code would be sent over the Internet It would turn on motor A until a touch sensor was pressed and then s
81. threshold on the RCX LCD for 4 seconds education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com V 290 Q Value of Value of Value of Value of Red Blue Yellow Generic Lower Lower Lower Lower Threshold Threshold Threshold Threshold Use these modifiers to represent the value of the lower threshold of the Red Blue Yellow or Generic Event Example This piece of code sets the red event to be a normal event with an upper threshold of 60 a lower threshold of 40 duration of 10 seconds and hysteresis of 2 The program will beep repeatedly until the sensor on channel 1 fulfills the event requirements It will then display the value of the red lower threshold on the RCX LCD for 4 seconds education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 291 NEA Value of Red Value of Value of Value of Hysteresis Blue Yellow Generic Hysteresis Hysteresis Hysteresis Use these modifiers to represent the value of the Hysteresis of the Red Blue Yellow or Generic Event Example This piece of code sets
82. waits 05 seconds before adding one to the red container and repeating In this way the NXT will display a graph of the light sensor value over time the red container acts as a counter and allows pixels to be displayed at equal time intervals This will display for 2 seconds before the program ends education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 318 This command allows you to draw a rectangle on the NXT display To locate the rectangle you need to give coordinates for the x y position of two of its corners The display s dimensions are 100 by 64 Position 0 0 is in the lower NXT Draw Left corner of the NXT display To provide the Rectangle x and y locations right click control click for Mac users on the Lower left and right corners and choose create constant or get numeric constants from the modifiers menu Also you can use the value of sensors or containers as coordinates 7 ct Example This program will draw a rectangle on the NXT display and then erase half of it First clears the NXT display Then it draws a rectangle that from 10 10 to 80 50 After 2 seconds it will erase a rectangle from 40 1 to 80 50 Then the NXT will be displaying the Left half of the rectangle it will look
83. ww MINDSTORMSeducation can amp ww LEGQengineer ing com 310 B NXT Commands Use this command to start an inventor program when using an NXT Begin NXT Example This code is for the NXT It will turn on motors A and C for 4 seconds and then stop ALWAYS start direct NXT programs with this g command By running in direct mode you need to HYT have the NXT continually connected to the computer Being Direct Mode Example This is an NXT direct code It will turn on motors A and C for 4 seconds and then stop The NXT must be connected to the computer to run this code education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 311 Use this modifier when a sensor is connected to port 4 of the NXT It works in the same way as the Port 1 2 and 3 modifiers Input 4 Example This program turns on motors A and C and then waits for the NXT touch sensor on port 4 to be pressed Once the touch sensor is pressed the motors are turned off Use this modifier to get the value of a sensor ee connected to port 4 of the NXT It works in the Same way as the value of Port 1 2 and 3 modifiers Value of Port 4 Example This program takes the value from the NXT light sensor on port 4 and places it i
84. zeros the touch and release sensor If after 10 seconds the touch and release sensor reads 10 the default the RCX plays a sound F p Use this fork if you want to take different NXT courses of action based on the volume of a room Sound as measured by the NXT sound sensor A fork merge Sensor is required at some point after this icon Equal Fork Example This piece of code turns on motor A If the sound sensor does not read a value of 55 then the RCX plays a sound After 2 seconds the motor is shut off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 93 Use this fork if you want to take different courses of action based on the volume of a room Distance as measured by the NXT sound sensor A fork merge Sensor is required at some point after this icon Equal Fork Example This piece of code turns on Motor A in reverse if the volume is not equal to 10 If the volume is equal to 10 a sound is played The code then jumps back to the beginning to start again education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww
85. 06 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 39 Wait Fors p T f i Wait for Wait for Wait for Wait for 1 second 2 4 8 10 seconds seconds seconds seconds Use these icons if you want to wait for the specified amount of time before moving on to the next command Useful to choose duration of motor and lamp activity Example This piece of code would turn on motor A in the reverse direction for 2 seconds and then turn it off Use this icon if you want to specify the number reg of seconds to wait before moving on to the next Wait f r command Useful to choose duration of motor and lamp activity Time Example This piece of code would turn on motor A for the number of seconds specified on the control panel and then turn it off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 40 Use this if you want to wait a random amount of a time before moving on to the next command Use Wait for modifier to change the max random time from 5 Randon seconds Useful to choose duration of motor and Time lamp activity Example This piece of code would tu
86. 55 then the RCX plays a sound After 2 seconds the motor is shut off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 90 Y Use this fork if you want to take different aeris courses of action based on a temperature Fanrenheri sensor A fork merge is required at some Equal Fork point after this icon Example This piece of code waits one second and reads the temperature If the temperature is not 80 degrees Fahrenheit the default it will play a sound Fo Use this fork if you want to take different Mailbox courses of action based on the value of the Equal mailbox A fork merge is required at some point Fork after this icon Also an empty mailbox command Should be used sometime before this icon Example This piece of code empties the mailbox and then waits 10 seconds If after those 10 seconds the mailbox has a value of 1 the default the RCX plays a sound education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 91 Use this fork if you want to take different courses of action b
87. 66 Wait for Increase in Voltage Generic 63 Wait for Increasing HUMTAT UY seuseicenki 63 Wait for Increasing PrESSUT O eusian 65 Wait for Increasing Sound LOVE a cours yeneeeeecaees 65 Wait for Increasing Temp CE E E seefeestesoncnseseeteen 58 Wait for Increasing Temp GIP E E E E EE 58 Wait for Increasing Temperature C essees 66 Wait for Let GO 44 Wait for Light 44 Wait for Mail ee 59 Wait for N hundredths of a SOCON e 41 Wait for N Points 43 Wait for Position Decrease P EP S A EIE AAEE EA 64 Wait for Position Increase EN E EEE E TE sa taeone 64 Wait for PUSH ees 43 Wait for Random Time 40 Wait for RCX to be in view E wanes 299 Wait for Rotation 47 Wait for Rotation w o Reset TEP aes E N E eas E dees 46 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com Wait for Time eee 39 Yellow Scroll wee 173 Wait for Time min 0000 42 Yellow Timer eee eee 272 Wait for Timer 61 Zero Angle Sensor 201 Wait Fors cece ceeeecccsseccceecceeesecenees 39 Zero Clicks Sensor 000 198 WELL Time 330 LTO CLOCK sore ie 203 Whole NOte eessen 175 Zero Container 201 Write Data Point to Data Zero Light Sensor 199 ee enone ene 188 Zero Mat lLDoX eee ewes 202 RN PLO Ceseen
88. B or C icons To specify a power level String in a numeric constant 1to 100 are forward is stopped no power and 1 to 100 are backward Example Motors A and C will turn on in the forward direction at speed 50 After 4 seconds the motors will be turned off LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 27 This command will turn on motors at a power level specified by a string Indicate the motors by using the port A B or C icons or encoder A B or C in the NXT commands menu To specify a Forward power level right click control click for Mac Or users on the lower right corner and choose Back Create Constant This will allow you to type in String the name of a string variable to use to control motor speed Example a T P Ti Ie m ir Tm a yi m P i wen m i i aed l speed 1 rotation In this example an NXT motor is trying to remain in the same position The value of the encoder on NXT motor A is placed in a string container called rotation The value speed is calculated using the Evaluate Expression command Then the variable speed is used as the power level for Motor A This process repeats indefinitely as it is inside jump command
89. BEE REREEEE ENI BERR ERREEE EN I i I TT i i ROBOLAB Reference Guide Version 1 4 eco education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com Preface Getting Help with ROBOLAB ROBOLAB is a growing application for which users can receive support in many different ways Embedded in ROBOLAB are context help and extended help information and examples A PDF is available on the ROBOLAB CD that focuses on teaching readers how to use different components of the software Several books have been written that focus on tips and tricks for using ROBOLAB and LEGO bricks and accompanying activities for use with students These books include Physics by Design by Barbara Bratzel http www collegehousebooks com physics by design htm and Engineering with LEGO Bricks and ROBOLAB by Eric L Wang http www collegehousebooks com lego bricks htm Carnegie Mellon s Robotic Institute has developed additional support Their NXT Mobile Robotics Curriculum and NXT Engineering Projects Curriculum is available at from your LEGO Education distributor The web also serves as a means of finding information new Capabilities suggested ways to use the software classroom curriculum and additional tut
90. CX Change sounds using the sound type modifier This modifier must be an integer from 1 to 6 Each represents a pre programmed sound 1 Key click 2 Beep Beep 3 Descending Sweep 4 Rising Sweep 5 Buzz 6 Fast Rising Sweep Example This piece of code would play a fast rising sweep sound the default LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 19 Use this command to flip the directions of the motors once they are on Use the ports modifier to flip specific ports Without a modifier EE O this command will flip the direction of all ports This does NOT turn the motor on It needs to be used in combination with a command that starts the motor or at a point in your program where the motor is already on Example This piece of code would turn on motor A in the forward direction wait one second flip the direction of motor A to reverse wait one second and then turn motor A off ae Use this command if you want motors to come to a ioa more gradual stop This command will simply stop powering the motors Use the ports modifier to Outputs P float specific ports Without a modifier this command will float all ports Example This piece of code would turn on motor A in the forward direction for on
91. Dorrera E N 17 LAD C a 17 LONGI seer a E EA 104 Lavender Bif eisini 343 Light Blue Bin 343 Light Container 218 Light Sensor Equal Fork 89 Light Sensor FOrk ccee 81 LINE SODE sonarson 337 Load Dre ek nee er emer rere ene ere 34 Load Scroll From File 174 Load Sound ee eeeeeeeeeeeeeeeees 356 Log Time Stamp ee 191 Loop Counter Container 293 Loop While eeens 121 Loop While Camera Sensor is Greater Than eee 120 Loop While Camera Sensor is Less Than 401 Loop While Celsius is Greater Than 113 Loop While Celsius is Less Te Pl ETIA EAEI ET 113 Loop While Clock Value is Greater Than eee 116 Loop While Clock Value is Less NAN eeri 116 Loop While Container is Greater Than eee 110 Loop While Container is Less Than 110 Loop While Container Value Is Not Equal To 121 Loop While Fahrenheit is Greater Than eee 115 Loop While Fahrenheit is LESS bAa 115 Loop While Humidity is Greater Than 00000000000000 125 Loop While Humidity is Less TO a tess eeeess 125 Loop While Light Sensor is Greater Than 109 Loop While Light Sensor is LESS WA Meters e 109 Loop While Mail is Greater TNS arar E 114 Loop While Mail is Less Tel e 114 Loop While Number of Clicks is Less Than 108 Loop While Number of Touches and Releases is Less Than 107 Loop While NXT Distance Sensor is Greater Than 118 Loop While NXT Distance Sensor is Less Than
92. EGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 346 Use this like an Internet Start icon This does NOT take pictures it just initializes the Init camera Use this if you want to take pictures internet over the Internet Image Example Intensity Graph This piece of code initializes an Internet image takes a green image from a remote camera and converts it to an array which is displayed as an intensity graph on the front panel Use this like an End icon This is required at the end of all camera program strings Close Camera Example This piece of code initializes a small image allows the user to adjust camera options takes a color image and saves it as a bmp file education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 347 Use this to set up camera properties options CIT etc QT Setup Example This piece of code initializes a small image allows the user to adjust camera options takes a color image and Saves it as a bmp file Tik Use this to grab a full color image pe Grab RGB
93. EGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 185 Use this command to initiate data collection from the NXT touch and release sensor It might be helpful to zero the NXT touch and release sensor at the beginning of the code NXT If you do not add a Data Set modifier the Initialize data will be collected as the Red Data Set Touch And default Release Sensor Logging Example This piece of code zeros the NXT touch and release sensor Then it logs touch and release sensor data every second for 45 seconds and stops Use this command to collect data from a container Initialize Container Logging Example This piece of code empties the container then logs container data for 4 seconds and then stops LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 186 Use this command to collect data from the mailbox Initialize Mail Logging Example This piece of code would take 50 data points from the mailbox Use this command to initialize logging of the RCX clock Initialize Clock Example This piece of code logs 100 data points from the clock education LEGO
94. GO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 52 Use this icon to wait for the distance sensor to read a distance in cm that is greater than the NXT Forward number specified before moving onto the next Distance Command X Example This piece of code turns on Motor A then waits for the distance sensor to have a value of greater than 10 in which case it stops It then waits for the distance sensor to read a value less than 10 Next it jumps back to the beginning of the program and starts again education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 53 Use this icon to wait for the distance sensor to read a distance in cm that is less than the heal number specified before moving onto the next Reverse command Distance X Example This piece of code turns on Motor A then waits for the distance sensor to have a value of greater than 10 in which case it stops It then waits for the distance sensor to read a value less than 10 Next it jumps back to the beginning of the program and starts again Use this icon to wait for the sound sensor to notice a volume greater than the specified
95. GO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 182 Use this command to initiate data collection x from the NXT distance sensor If you do not add a Data Set modifier the data will be collected as the Red Data Set default NXT Initialize Distance Sensor Logging Example This piece of code initiates distance sensor logging on the NXT distance sensor on port 1 It begins data collection logging distance sensor data every 0 1 seconds Motors A and C turn on After 4 seconds data collection and the motors stop Use this command to initiate data collection from the NXT sound sensor It might be helpful to zero the NXT sound sensor at the beginning of the code If you do not add a Data Set modifier the data will be Logging collected as the Red Data Set default NXT Initialize Sound Sensor Example This piece of code initiates sound sensor logging on the NXT sound sensor on port 2 It begins data collection logging sound sensor data every 0 1 seconds for 30 seconds education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 183 Use this command to initiate data collection from the enc
96. Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 174 Use this to play a song file you have saved Load Scroll From File Example This piece of code brings up a dialog box for you to choose a song Then it plays that song O Up an Octave Down an Octave Use this to play a note in octaves above or below the Standard octave String several of these together to play several octaves above or below standard These icons are used as modifiers Example This piece of code plays C one octave above standard then in the standard octave then one octave below standard education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 175 oO DO YO Q Sixteenth Eighth Quarter Half Note Whole Note Note Note Note Use these to play notes These icon are used as modifiers Example This piece of code plays C as a sixteenth note D as an eighth note E as a quarter note F as a half note and G as a whole note in the standard scale education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non c
97. Histograms are useful for plotting the distribution of your data how often you measured certain values or certain ranges of values Example This piece of code takes the data from the Red Bin creates a histogram of the data using 15 bins and plots the result to the Brown Bin education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 335 Use this command to integrate data If multiple Vat plots are input each one will be integrated Integrate separately Example This piece of code takes the data from the Yellow Bin Integrates it and plots the result in the Brown Bin multiple plots are input each one will be Use this command to differentiate data If dt differentiated separately Differentiate Example This piece of code takes the data from the Yellow Bin differentiates it and plots the result in the Brown Bin education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 336 Use this command to create a plot of the maximum value in a data set The value can also be Maximum displayed on an in
98. MINDSTORMSeducation can amp ww LEGQengineer ing com 98 Use with Investigator commands Use this fork if you want to take different courses of action based on the number of points gathered A fork merge 1s required at some point after this icon This piece of code logs light sensor data points for 6 seconds If after that time there are not 5 the default data points the RCX plays a sound before stopping If after the 6 seconds there are 5 data points it stops logging points no sound LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 99 Use this fork if you want to take different courses of action based on the value of the RCX clock A fork merge is required at some point after this icon Example This piece of code would check the value of the RCX clock If the clock did not read 1 minute the default then motor A would turn on for 8 seconds Use this fork if you want to take different vot a courses of action based on the value of the anaes Camera sensor A fork merge is required at some Sensor point after this icon Equal Fork Example This piece of code would turn on motor A for 4 seconds then turn it off The direction of the motor is determined by the value of the camera sensor If the
99. Powerdown Time Specifies the amount of time in minutes that the RCX will remain on before shutting down This setting can be changed from within ROBOLAB in Administrator in the RCX Settings Section Number of Retries Specifies the number of times ROBOLAB will attempt to talk with the RCX via the tower If ROBOLAB completes the number of retries without successfully communicating an error will be reported This number can be increased if you are having difficulties communicating with the tower it can also be decreased for those wanting the RCX communication to time out faster for instance when the RCX 1S moving in and out of tower range Serial Wait Time msec Specifies the time between retries This number should be Increased if you are working with a slower computer that is having difficulties with the serial communication Path to Investigator Vault Specifies the path to the folder where Investigator Projects are stored This tag is changed from within ROBOLAB in Administrator in the ROBOLAB Settings section education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 370 Network Address Specifies the default address used to communicate when Internet mode is selected from Select COM Port in the Project Menu or fro
100. Programming Icons and Examples This chapter provides additional hints and example programs for all of the ROBOLAB icons excluding a few higher level palettes The examples can also be accessed through the extended help in ROBOLAB 2 5 and higher using the Click here for more help link in the Help Window The sections were created using the highest most comprehensive level of ROBOLAB Investigator Program Level 5 Hence if you are using Lower levels of Inventor or Investigator some of the icons Listed may not appear on your Functions Palette education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 16 Basic Outputs Always start an Inventor program with this command Example This piece of code would turn on motor A for one second and then turn it off Always end an Inventor program with this command End Each task will need its own end command Example This piece of code would turn on motor A for one second and then turn it off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com
101. S anina 343 Clear Sound Buffer 262 AND Container 2 eceees 213 Click Equal Fork 91 Angle Container 22 CETEK 0 Gl eee mn en ae ees 83 Area Under Curve 338 Clicks Container 0 234 Average Lines eesse 329 Clock Container eesse 237 Barometric Sensor Container Clock Equal Fork 99 E A E I E 252 CLOCK FOTK rarussenaronracemes OF BW AEE 16 Close Camera 346 Begin Control Lab Interface GIO SS TC an 356 S E E E 308 COMO TIO errana Ol Begin direct mode 303 Combine BINS eee 327 Begin Direct Mode 308 Container Equal Fork 88 Begin Internet 301 Container FOFrK cece 79 Begin LASM ccocctccesescectncegncceceseacens 302 Container s Container 268 Bie SAIN NAM son 310 COMTOKE a l 3 BESTI RCA orrian 302 Convert to Array sess 351 Begin End Direct Mode 295 Convert to Image 0 352 Being Direct Mode 310 Convert to Picture 350 BIO PLOT eee eee nee ea 328 Create Subroutine 69 BLack JUMP esaceecaasieecocesecestsscateceene 102 Data Points Equal Fork 98 Bai AN sior 103 Data Points FOrK eesse 84 BU Os reana 102 103 Do ALG D enrenar r 367 Blue Bin cccccccsssseeeeeeeeees 343 Define Event ee 169 Blue Container e 266 Delete Subroutine 70 Blue Data S t uu eee 273 Delete TaSKS ccccccccccccccsssteeeeees 68 BLUS EVENT sa
102. STORMSeducation can amp ww LEGQengineer ing com Bi Read 298 Use this command in direct mode to determine the remaining battery power of your RCX Useful if your battery power significantly impacts RCX Battery performance Power Example This piece of code will display the Battery Power level on the front panel between 0 9 Volts Read Value Use this command in direct mode to read the value of any memory Location This command will NOT automatically display that value To display automatically use the Read and Display Value command To display using the Read Value command String an indicator to the Value read terminal Also you can choose which port to poll using the modifier to read terminal Example This piece of code reads the value of sensor 1 in direct mode and displays it to the control panel education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 299 TAT Use this command in direct mode to read and o display the value of any memory location This Raad and command displays automatically Choose which port Display to poll using the modifier to read terminal Value Example This piece of code waits until the RCX is in view of the tower then reads and displays the value of sensor 1
103. STORMSeducation can amp ww LEGQengineer ing com 286 O amp Q Value of Value of Value of Red Data Set Blue Data Set Yellow Data Set Use these modifiers to use the value of the red data set Example This piece of code initializes the light sensor on Port 1 begins data logging in the Red Data Set for 10 points and then fills the Blue Container with the last value taken in the Red Data Set The value of the blue container is then displayed on the RCX education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 287 Red Blue Yellow Generic Event Event Event Event String these modifiers to an event definition or monitor command to select the Red Blue Yellow or Generic Event Example This piece of code sets up a red event that is triggered when the touch sensor is pressed The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the touch sensor is pushed in This will force the program out of the jump sequence and make it land where the Event Landing is located LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other right
104. The default is a red event that waits for 10 touch and releases on NXT Set port one This command must appear before the Up Begin Monitoring command in your program You can Release string in a yellow blue red or generic Event modifier to have several events You can also String in an event source source of information such as sensor values of ports 1 2 and 3 container values or mail values Example This piece of code sets up a blue event that is triggered when the number of touch and releases of the touch sensor equals the clicks threshold The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the number of touch and releases of the touch sensor equals the clicks threshold This will force the program out of the jump sequence and make it Land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com NXT S Up Li Event 15 7 3 This command sets up an event to occur when the value of the NXT light sensor goes above the threshold The threshold can be modified with an event modifier The default is a red event that et waits for a light reading higher than 55 from ght port one This command must appear before the
105. This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineering com 65 Wait for Wait for Increasing Decreasing Pressure Pressure Use these icons to wait until the sensor reads a value of Less than the cutoff pressure before moving on to the next command Example This piece of code would turn on motor A When the sensor reads a value of Less than 100 kPa the default the motor would be shut off dE Wait for Increasing Sound Decreasing Sound Level Level Use these icons to wait until the sensor reads a value of Less than Wait for Increase icon or greater than Wait for Decrease icon the cutoff sound Level before moving on to the next command Example This piece of code would turn on motor A When the sensor reads a value of Less than 60 decibels the default the motor would be shut off LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 66 Increasing in Temperature C Temperature C Use these icons to wait until the sensor reads a value of less than Wait for Increase icon or greater than Wait for Decrease icon the cutoff temperature before moving on to the next command Example This pi
106. USB Sample Default prf File Summary of Tags Preference File Indicates the last time ROBOLAB modified the file It should not be edited outside of ROBOLAB Path to Program Vault Indicates where User Data is stored on the computer This tag is changed from within ROBOLAB in Administrator in the ROBOLAB settings section Locked Indicates whether or not Programs 1 amp 2 on the RCX are locked new programs are unable to be downloaded to these Slots This tag should be changed from within ROBOLAB in Administrator in the RCX Settings section education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 369 Admin Specifies whether the Administrator button on the front panel is visible or not This tag can be changed in the main section of Administrator TRUE Hi means the Administrator Button is visible FALSE Low means the Administrator Button is NOT visible If the button is hidden hit F5 when in the main ROBOLAB Splash page Power Specifies whether the RCX is transmitting IR signals in high or low power mode This setting can be changed from within ROBOLAB in Administrator in the RCX Settings Section FALSE low RCX is transmitting in Low power mode TRUE hi RCX is transmitting in high power mode
107. a rest while the touch sensor remained released When the touch sensor was pressed it would play a sound Use this to start a loop while the NXT touch sensor is pressed The loop will end when the Ez touch sensor is release If the touch sensor is not pressed when the program reaches this OOP command it skips the loop To avoid this add a Wait for Push icon before this icon An End of Touch Loop icon is needed somewhere after this icon Sensor 1S Pushed Example This piece of code would wait until the touch sensor was pushed then start a loop that would continuously play the note C and a rest while the touch sensor remained pushed When the touch sensor is released it will play a sound education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 107 Use this to start a loop while the NXT touch Es sensor is NOT being pressed The Loop will end i when the touch sensor is pressed If the touch NXT Loop sensor is pressed when the program reaches this While command it skips the loop An End of Loop icon Touch is needed somewhere after this icon Sensor is Let Go Example This piece of code would start a loop that would continuously play the note C and a rest while the touch sensor remained released When
108. age may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com This piece of code plays C C D D notes in the standard scale Use this to play a rest or pause E and F as quarter This piece of code would start a loop that would continuously play the note C and a rest the default is a quarter rest until the number of touches and releases was 10 the default education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 173 o Fd Use this to play any note by choosing a frequency care and duration Play Any Note Example This piece of code plays a whole note A the frequency is specified by the constant 540 wired in Red Scroll Blue Scroll Yellow Scroll Use this to play the music stored on the scrolls If you haven t stored any music to the scrolls in piano player the default songs will play The red scroll plays Frere Jacques The blue scroll plays Row Row Row your Boat The yellow scroll plays Twinkle Twinkle Little Star Example This piece of code plays the music on the red scroll then a quarter rest and the note C education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO
109. ally create a stealth RCX or when you want to program your RCX in the library Example This piece of code when run will mute all further sound except of those made by pressing RCX buttons This mute applies to other programs existing or newly download The only way to get sound is to include or run the Unmute Sound command education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 263 aw Use the Unmute Sound icon to restore the sound Ble Capabilities to your RCX This is the opposite TEES of Mute Sound Unmute Sound Example This piece of code when run will unmute sound on the RCX education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 264 Modifiers Output A Output B Output C Use these modifiers to indicate to which port your output device 1s connected Example This piece of code would turn on motors connected to Ports A and B in the forward direction After 4 seconds it would turn them off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO G
110. alues of ports 1 2 amp 3 container values or mail values Example This piece of code sets up a red event that is triggered when the generic sensor value goes below the threshold The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the generic sensor value goes below the threshold This will force the program out of the jump sequence and make it land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 168 This command sets up an event to occur when the value of the timer goes above the threshold Set Up The default 1s a red event that waits for a timer value of one second This command must ri est appear before the Begin Monitoring command in Event your program You can string in a yellow blue red or generic modifier to have several events You can also string in an event source source of information such as sensor values of ports 1 2 amp 3 container values or mail values Example This piece of code sets up a red event that is triggered when the value of the red timer goes above the threshold The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and
111. amp ww LEGOengineering com 133 Events iC Use this command to begin watching for an Start event This command must be used in every Monitoring event program for an Event Example This piece of code sets up a red event that is triggered when the touch sensor is pressed The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the touch sensor is pushed in This will force the program out of the jump sequence and make it land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 134 Ci This command stops the program from watching for events Stop Event Monitoring Example This piece of code sets up a blue event that is triggered when the touch sensor is touched and released The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the touch sensor is pushed in and released This will force the program out of the jump sequence and make it Land where the Event Landing is located The program then stops monitoring for events because of the Stop Event Monitoring icon education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group
112. ample This piece of code turns on Lamp A Once the angle sensor on Port B reads a value of greater than 720 degrees two rotations Lamp A turns off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 37 Use this icon to wait for a number of degrees to be completed but do NOT want to reset the NXT rotation sensor to The general wait for Wait rotation sensor resets to 0 and then waits for for the cutoff degree Rotation w O Reset Example This piece of code turns on Lamp A waits for 720 degrees from the sensor then turns Lamp A off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 58 EF eb Wait for Wait for Decreasing Increasing Decreasing Increasing Temp C Temp C Temp F Temp F Use these icons to wait for the temperature sensor to read a value less Wait for Increase or greater than Wait for Decrease than the cutoff temperature specified before moving on to the next command Example This piece of code turns on Lamp A then waits for the temperature sensor to
113. ased on a rotation sensor A fork merge is required at some point after this Sensor icon Also a zero angle sensor command should be Equal used sometime before this icon Reminder Fork rotation sensor reads in sixteenths so a reading of 16 equals one rotation Rotation can be either forward or backward Example This piece of code zeros the angle sensor If after 10 seconds the angle sensor reads 16 one rotation the default then the RCX plays a sound Use this fork if you want to take different courses of action based on the number of clicks on a touch sensor A fork merge is required at some point after this icon Also a zero clicks sensor command should be used sometime before this icon Example This piece of code zeros the click sensor If after 10 seconds the click sensor reads 10 the default the RCX plays a sound LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineering com 92 Use this fork if you want to take different Touch courses of action based on the number of touches and and releases on a touch sensor A fork merge is Pa Lease required at some point after this icon Also a Equal zero touch and release sensor command should be Fork used sometime before this icon Example This piece of code
114. ast rising sweep sound until the touch sensor is pressed The pressing of the touch sensor is set up as a red event Jumping 1s useful when certain commands are to be repeated A modifier from 1 20 can be strung into this jump icon to denote which jump the program is executing A Landing command with the same number needs to be used in conjunction with its corresponding Jumping command Example This piece of code will play the fast rising sweep sound until the touch sensor is pressed The pressing of the touch sensor is set up as a red event education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 104 Jumping 1s useful when certain commands are to be repeated Place the Landing command where you want to start after a jump A modifier from 1 20 can be strung to this landing icon to denote which number jump the program is executing A Landing command with the same number needs to be used in conjunction with its corresponding Jumping command re anding Example This piece of code will play the fast rising sweep sound until the touch sensor is pressed The pressing of the touch sensor is set up as a red event LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page
115. ata Set for 10 points This code captures data every second education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 275 Use this modifier in a data acquisition program to take a sample every time the touch sensor is pressed on port two Touch Sampling Example gt a First this piece of code zeroes the touch sensor on Port 2 It then initializes the light sensor on port one and begins to take data points in the Red Data Set every time the touch sensor on port 2 is pressed The program stops data logging when the user gets 10 points education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 276 Subroutine to capture data points every time you write to the data set and marks the data with time The time will rollover every 2 16 tenths of a second String this modifier to a Start Data Logging Free Sampling with Time Stamp Example This piece of code initializes the light sensor on port one takes 10 data points on the Red Data Set and then Stops taking data points It captures data every tim
116. ation can amp ww LEGQengineer ing com 254 ey education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 255 5 RCX Communications ee Use this icon to send mail numbers to another ea RCX There must be a continuous line of site Sand between the 2 RCXs when the program is run Mail Example This piece of code would send a value of 10 to the mailbox of another RCX Use the icon to control the LCD display on your RCX You can display any modifier in this area This can be useful for debugging mail or container issues as well as monitoring sensors Displ opra The display is only set to view the modifier while the program is running Example This piece of code would display the value of the yellow container for 4 seconds education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 256 Use this to change the display on the RCX to Information from the inputs 1 2 3 outputs Change Paige anal clock 0 The default is to display View on me CLOCK RCX Example This piece of code will turn on
117. ation to the ground its overall physical health and more using LabVIEW LabVIEW is a graphical programming development environment that allows scientists and engineers to write programs and create user interfaces A basic LabVIEW program called a virtual instrument vi has 2 components to it a front panel and a diagram The front panel is where standard user interface options like buttons dials and graphs are displayed education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 11 Run Button addtvwonumbers i E E Student Edition L s O dee A Simple LabVIEW Front Panel The simple LabVIEW front panel for the vi addtwonumbers vi above allows the user to enter two numbers Number 1 and Number 2 when the program is executed by pressing the run button What happens when the run button is pressed is defined in the diagram The diagram defines the Logic and operations of the vi LabVIEW program education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com addtvonumbers i Diagram 2 bale o Stu
118. be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 118 Loop While NXT Loop While NXT Distance Sensor iS Distance Sensor is Less Than Greater Than Use this to start a loop while the NXT distance sensor value is above a certain number The loop will end when the distance sensor value goes below that number If the distance sensor value is below that number when the program reaches this command it will skip the loop An End of Loop icon is needed somewhere after this icon This piece of code starts a loop that would continuously play the note C and a rest until the distance sensor value became 50 or greater It would then turn on Motor A for 2 seconds stop Motor A for 1 second and then jump back to the beginning of the code to start again LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 119 Loop While NXT Loop While NXT Motor Motor Angle Sensor Angle Sensor is Greater is Less Than Than Use this to start a loop while the NXT rotation sensor reads below a certain value The loop will end when the angle sensor gets to or goes beyond that value It 1s helpful to use a zero angle sensor icon before this command An End of Loop icon is
119. bin The slope value is also displayed in numeric form as an indicator on the front panel education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 338 Use this command to find the area under the curves of a graph The area is displayed best Area Under as an indicator on the front panel Curve Example This piece of code takes data from the Yellow Bin and calculates the area under the curves The result is displayed as an indicator on the front panel Use this command to find the standard deviation of data Standard Deviation Example This piece of code takes data from the Yellow Bin calculates the standard deviation and plots the result to the purple data bin To view the original data and the Standard deviation at the same time use the Compare template in the View and Compare section of Investigator education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 339 Use this command to fit a y AlnX B line to the ail desired Data Set The equation of the fit line Fit Ln offsets and slopes can be disp
120. bove Less Than icon or below Greater Than icon that number An End of Loop icon is needed somewhere after each icon Example This piece of code will start a loop that plays notes C and D continuously while the value of the pH sensor adapter is less than 7 the default When the reading goes above this the loop will stop education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 127 Loop While Loop While Pressure is Less Pressure is Than Greater Than Use these to start a loop while the value of the pressure sensor adapter LogIT is less than or greater than some number The loop will stop when the value goes above Less Than icon or below Greater Than icon that number An End of Loop icon is needed Somewhere after these icons Example This piece of code will start a loop that plays notes C and D continuously while the value of the pressure sensor adapter is less than 100 kPa the default When the reading goes above this the Loop will stop education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com
121. camera value is 55 the default the motor goes forward Otherwise the motor goes in the reverse direction education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 100 Use this fork to take different actions based on r whether an event has occurred or not Useful if evant you are monitoring for multiple events and wish Fork to take different actions for different events Example This piece of code part of a larger program would play a D note if the red event had occurred If the red event had not occurred it would play an E note a Use this fork to take different actions based on whether the Timer reading in hundredths of a l second is greater than or less than or equal to Timer to an amount of time 01 Fork Example This piece of code will beep for 600 hundredths of a second 6 seconds and then jump to the blue land education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 101 Use this fork to take different actions based on ss whether the Timer reading in hundredths of a Timer second 1
122. can amp ww LEGQengineer ing com 196 Use this command to take voltage data from the LUX sensor Initialize LUX Sensor Logging Example This piece of code would take 10 data points from the lux sensor Use this command to take voltage data from the barometric sensor Initialize Barometric Sensor Logging Example This piece of code would take 10 data points from the barometric sensor education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 197 P Use this command to take voltage data from the redox sensor Initialize Redox Sensor Logging Example This piece of code would take 10 data points from the redox sensor Hints Use this command to take voltage data from the current sensor Initialize Current Sensor Logging Example This piece of code would take 10 data points from the current sensor education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineering com 198 Use this to reset the touch sensor J Helpful if ae taking touch sensor data Zero Touc
123. can amp ww LEGQengineer ing com 382 panel back Therefore you might want to make your own template described in the next section The Hard Way To make templates that Look and act just like the templates that came with ROBOLAB entails programming in LabVIEW However it is possible to create templates like the ones below that are embedded in Investigator and can be completely customized to the needs of specific application or need The template below allows for a customized programming interface to be added to the Program area Behaviors pg a B E T 1S wml werent ee Program 1 h Developers interested in creating customized templates should visit www lego com eng education mindstorms or www ceeo tufts edu robolabatceeo to download the latest documentation and code needed for creating customized templates At the website are instructions on how to make a title page in the journal area a behavior based programming page in the programming area an upload page that uploads microphone measurements and a View area page education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineer ing com 383 that returns the natural frequency of a data set To learn about programming in LabVIEW refer to either the LabVIEW Student Edi
124. ch sensor is pushed in This will force the program out of the jump sequence and make it land where the Event Landing is located The program then resets all events and begins monitoring for the red event to happen again A different sound will keep playing until the touch sensor is pushed again education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 149 Po This command forces an event to be triggered It 1 basically overrides the system in order to make Force An an event occur String in the yellow blue or Event red event modifier in order to force that particular event Example This piece of code sets up a blue event that is triggered when the touch sensor is touched and released The Monitor Event icon begins monitoring for such an event to occur In this case the Force Event icon will the program into thinking that the event has really happened even thought the touch sensor was never pressed and force it out of the jump Loop education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com Set Up 150 Th
125. cial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 123 Use this piece of code to start a loop that is TES going to be repeated a certain number of times Start of deere of Loop icon is needed somewhere after Loop is icon Example This piece of code would turn lamp A on for 2 seconds and then off for 2 seconds and repeat this 9 more times In total the light blinks 10 times education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 124 ALWAYS end loops of any kind with this icon End of Loop Example This piece of code would turn lamp A on for 2 seconds and then off for 2 seconds and repeat this 9 more times In total the Light blinks 10 times Loop While Value of Generic Sensor of Generic Sensor is Less Than 1s Greater Than Use this to start a loop while the value of the generic sensor adapter is less than or greater than some number The loop will stop when the value goes above Less Than icon or below Greater Than icon that number An End of Loop icon is needed somewhere after each icon Example This piece of code will start a loop that plays notes C and D continuously while the value of the generic sensor adapter is less t
126. code fills the Red Container with the number of touch and releases of the touch sensor A sound is played and the value of the Red Container 1s shown on the RCX If the number of touch and releases was 3 the RCX would read 3 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 236 oa Use this command to fill a container with the tl number of data points collected in a data set Saati es The default is to set the Red Container to the Container number of data points from the Red Data Set Example This piece of code initializes the touch sensor on Port 1 on the Red Data Set then begins taking data It waits 10 seconds and then fills the Red Container with the number of points on the Red Data Set after that time It then displays this number on the RCX and continues to wait until 35 data points are collected on the Red Data Set education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 23d Use this command to fill a container with the value of the clock The default is to set the Red Container to the value of the c
127. d Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 329 This command takes a bin with multiple plots and r averages them into a single plot Average Lines Example This piece of code creates a graph that is the average of all the lines in the light blue bin and plots it to the olive bin Use the Compare template in the View and Compare area to see the original data in light blue bin and the averaged data in the olive bin education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com Well Time 330 Well Time is the time between two peaks peaks are defined as values above a threshold or cutoff value Use this command to determine the amount of time between peaks below the cutoff value of a data set If you have multiple peaks on your graph this command will return a graph of the well times between each one Useful for measuring for time between touch sensor presses or light sensor spikes Example This piece of code creates a graph of all the well times below the cutoff value for the red data set and plots it in the purple bin education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational
128. d for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 344 Example This piece of code averages all the Lines in the Red Bin and averages all the Lines in the blue bin It then combines them into one plot that is plotted in the lavender bin Example PFF FPFF T 70 00 This piece of code extracts the values from the data set in the purple bin if the data in the orange bin is between 70 and 101 and plots the result to the green bin education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 345 Ek A Multimedia Use this like a Start icon This does NOT take oa pictures it just initializes the camera Use rave Smati this if you want a smaller image Image Example This piece of code initializes a small image allows the user to adjust camera options takes a color image and Saves it as a bmp file Ti Use this like a Start icon This does NOT take B A pictures it just initializes the camera Use Init Large this if you want a larger image Image Example This piece of code initializes a medium image snaps a red Image and converts that image to a picture to be displayed on the control panel education L
129. d is then stopped i Use this command to turn on motors and lamps with TE their last power and direction settings Outputs On Example This piece of code assigns the speed of motor B to 3 and the direction of motor B to forward and then turns it on After 2 seconds it turns motor B off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 25 Use this command when you want the speed and Motor direction of the motor related to positive and Forward negative numbers or Back Example 2 i N anan Ar This piece of code puts the value 5 in the red container It then loops 11 times running the motor at the speed in the red container for 1 second beeping and then augmenting the value of the container by 1 Hence the motor runs backwards from speeds 5 1 stops while the power is equal to 0O and the runs forward from speeds 1 5 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 26 This command will turn on motors at specified power Level Indicate the motors by using the port A
130. dent Edition at A Simple LabVIEW Diagram The diagram above takes Number 1 and Number 2 and adds them together and displays the result in Answer Addtwonumbers vi 1s an overly simple example of LabVIEW s Capabilities but helps to demonstrate the graphical Interface and basic concepts ROBOLAB makes use of LabVIEW s capabilities and interface in several ways LabVIEW s intuitive graphical interface makes it easy for the developers of ROBOLAB to program quickly and easily ALL the customized screens and templates including the Administrator the Pilot Levels Investigator Vision Center and Piano Player are LabVIEW front panels Behind those front panels are diagrams that contain the complicated programming that provides their functionality education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 13 Piloti vi werrrerrrrere M The Pilot 1 Front Panel Piloti vi Diagram Piano Cntrls Piano Piano Cntris Play 7ooo i 1 0 1 p OO n MONON OCU nono nO nono ono nO nonce Eii a a Le frst A a ime seo wat or e visi su i KO The Pilot 1 Diagram a education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied fo
131. dicator on the front panel Example This piece of code takes data from the Yellow Bin creates a plot of the maximum value and plots the result in the purple bin The maximum value is also displayed in numeric form as an indicator on the front panel Use this command to create a plot of the mean value in a data set The value can also be Mean displayed on an indicator on the front panel Example This piece of code takes data from the Yellow Bin creates a plot of the mean value and plots the result in the purple bin The mean value is also displayed in numeric form as an indicator on the front panel education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 337 Use this command to create a plot of the minimum value in a data set The value can also be Minimum displayed on an indicator on the front panel Example This piece of code takes data from the Yellow Bin creates a plot of the minimum value and plots the result in the purple bin Use this command to create a plot of the slope of W the data set The value can also be displayed on iine an indicator on the front panel Slope Example This piece of code takes data from the Yellow Bin creates a plot of the slope and plots the result in the purple
132. e ROBOLAB Data folder see section 3 3 for location explanation The Default prf file can be edited in any basic text editor Notepad Simpletext Wordpad However the file should only be edited by advanced users or those trying to fix a communication problem Most of the settings can be altered from within ROBOLAB ROBOLAB should NOT be running while you are editing the Default prf file If while editing the file you manage to corrupt the file or are unable to correctly configure a setting the file should be deleted A new file will be created the next time ROBOLAB is run with the default factory settings education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 368 Preference File Last modified at 15 34 on 04 12 2001 Path to Program Vault My Computer Robolab My Data Program Vault Locked TRUE h1 Port 2 Admin TRUE hi1 Power FALSE Lo Powerdown Time 15 Number of Retries 10 Serial Wait Time msec 10 Path to Investigator Vault LGM I Desktop Folder Robolab94 My Data Investigator Themes Network Address somewhere outthere com Network Port 3237 Init each time TRUE hi Bytes Upload 10 Level 3 Steps 3 Investigator State 1 ID 2 OQ Error 1 Text 2 RCX 3 Scout 4 Control Lab Camera Kritteru
133. e photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 229 Use this command to fill a container with the value of the NXT touch sensor The default is to set the Red Container to the value of the NXT Touch NXT touch sensor on port 1 In your program be Sure to specify what port your NXT touch sensor 1S connected to with a modifier Container Example This piece of code takes the current value of the NXT touch sensor on port 1 and places it in the red container It uses this value to determine the number of Loops to run Because the touch sensor will either read 1 pressed or not pressed this program will either play a note once or not at all education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 230 Use this command to fill a container with the value of the NXT sound sensor The default 15 to set the Red Container to the value of the NXT Sound NXT sound sensor on port 1 In your program be Container sure to specify what port your NXT sound sensor 1S connected to with a modifier Example This piece of code initializes the NXT sound sensor on port 2 It then enters a jump where it will continuously take the value o
134. e second then it would float the motor education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 20 Use this command to turn on Lamps The ports modifier allows you to choose which Lamps you want to turn on If no modifier is used this command will turn on all ports Use the power level command to change from 5 bright to 1 dim Without a modifier the power level will be 5 Example This piece of code would turn on lamps connected to ports A and C at power level 3 After 6 seconds it would turn them off i r Use this to stop motors or turn off lamps This Stop command abruptly stops motors by braking To get Outputs a more gradual stop use the float command Use modifiers to choose which ports to stop Without a modifier this command stops all ports Example This piece of code would turn on motors A and B in the forward direction for two seconds and then stop both motors education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 21 Forward Reverse Use this to turn on the motor s in the f
135. e sure to specify what port your acceleration sensor is connected to with a modifier Example This piece of code fills the Red Container with the value of the accelerometer A sound is played and the value of the Red Container is shown on the RCX If the value of the accelerometer was 8 the RCX would read 8 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 251 we Use this command to fill a container with the ba value of the Lux sensor The default is to set the Red Container to the value of the Lux sensor on port 1 In your program be sure to specify what port your Lux sensor is connected to with a modifier Lux Sensor Container Example This piece of code fills the Red Container with the value of the LUX sensor A sound is played and the value of the Red Container is shown on the RCX If the value of the LUX sensor was 8 the RCX would read 8 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 252 Use this command to fill a container with the he value of the barometric sensor The defa
136. e you write to the data set and marks the data with time education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 27 String this modifier to a Start Data Logging Subroutine to capture data points every time Prac you write to the data set Sampling Example Li eo This piece of code initializes the light sensor on port one takes 10 data points on the Red Data Set and then Stops taking data points It captures data every time you write to the data set Use this modifier to use the value of the clock Since 00 00 in minutes Value of Clock Example This piece of code sets the clock to hours and minutes and then waits 12 minutes A sound is played and the value of the clock is displayed on the RCX education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 278 Use this command when you want to see the value of the firmware in your RCX Value of Firmware Example This piece of code fills the Red Container with the value of the firmware in your RCX and then displays it on your RCX screen
137. ece of code would turn on motor A When the sensor reads a value of less than 30 degrees Celsius the default the motor would be shut off ENER a Pe nee Wait for Increase Wait for Decrease in Voltage in Voltage t 1 Use these icons to wait until the sensor reads a value of less than Wait for Increase icon or greater than Wait for Decrease icon the cutoff voltage before moving on to the next command Example This piece of code would turn on motor A When the sensor reads a value of less than 2V the default the motor would be shut off LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 67 E Tasks amp Subroutines Structures Use this icon to start a new task The tasks run sa Simultaneously Each task needs an End icon Task stoplight Split Example This piece of code turns on motor A After 2 seconds it flips directions and after 4 seconds from the beginning 2 seconds from flip it turns off motor A Use this to restart tasks after they have been completed or stopped The Task Number modifier is only necessary if you only wish to restart a certain task and not all tasks This piece of code turns on motor A and lamp B If 6 seconds pass and the touch sensor has not been pr
138. ed for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 200 8 Use this to reset the temperature sensor butane Helpful if taking temperature data Zero Temperature C Sensor Example This piece of code resets the temperature sensor and then logs 10 data points Use this to reset the temperature sensor Helpful if taking temperature data Temperature F Sensor Example This piece of code resets the temperature sensor Then it turns on motor A When the temperature falls below 80 degrees Fahrenheit the default motor A is shut off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 201 Use this to reset the angle sensor Helpful if taking angle or rotation data Angle Sensor Example This piece of code zeros the angle sensor then waits 10 seconds If at that point the rotation sensor reads greater than 1 rotation a reading of 16 the default then the RCX plays a sound Use this to empty a container Helpful whenever you are placing new values in a container Container Example This piece of code would zero the container Then it would start a loop that plays the note C and adds one to
139. educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 359 3 1 Using Vision Sensors Outside of Vision Center Using Vision Center you can create custom vision sensors These sensors use various image processing functions to reduce an image down to a single number This number may represent one of many image properties e g the area of white space in a portion of an image the number of blobs in an image etc With Vision Center running you can assign a vision sensor one of the 8 default sensors or a custom sensor you create to a container on the RCX With the RCX in view you can continually update this container value with the value of your vision sensor as the image changes This way the RCX s actions can be linked to what the Lego camera sees while connected to your computer Another useful tool is to implement vision sensors without having Vision Center running Once you understand how Vision Center works you can create an Inventor program that grabs an image applies your sensor to that image then updates the value on the RCX using direct mode This method allows you to process images from within your own program without using Vision Center Vision Sensors Vision sensors are saved the V7s7on gt Video Sensors by default see section 3 3 for the location of your Vision folder To Include a vision sensor in your Inventor program use Select a vi and browse to the
140. educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 62 Wait for Increase Wait for Decrease in Camera Sensor in Camera Sensor Use these icons to wait until the camera sensor reads a value higher Increase icon or lower Decrease icon than the compare to number before moving on to the next command Example This piece of code would turn on motor A When the camera sensor reads a value of greater than 55 the default The motor would turn off and the RCX would play a sound education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com Wait for Decrease 63 SE 3 s a u ir j a rs nae Wait for Increase in Voltage in Voltage Generic Generic Use these icons to wait until the sensor reads a voltage of less than Wait for Decrease icon or greater than Wait for Increase icon the cutoff voltage specified before moving on to the next command Example This piece of code would turn on motor A When the sensor reads a value of Less than 2 Volts the default motor A would turn off eee Mee Wait for Wait for Decreasing Increasing Humidity Humidity Use these icons to wait until the sensor reads a value of less than Wa
141. efault iow 7 This icon is used to start direct LF communication between 2 RCXs Commands Start Direct RCX that appear between this icon and the End Direct RCX Communication icon are sent to another RCX in direct mode there must be a continuous line of site between the 2 RCXS Communication Example This piece of code would tell another RCX in Line of site to play each of the 3 notes Because the RCXs are talking in direct mode the other RCX would immediately play the notes education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 259 This icon is used to end direct E communication between 2 RCXs Commands End Direct RCX that appear between this icon and the Communication Begin Direct RCX Communication icon are sent to another RCX in direct mode there must be a continuous line of site between the 2 RCXs Example This piece of code would tell another RCX in line of site to play each of the 3 notes Because the RCXs are talking in direct mode the other RCX would immediately play the notes This icon is used to start the downloading of a program from one RCX to another The commands that are between this icon and the Download Start Remote Remote Program icon would be downloaded t
142. elp on working with the ROBOLAB environment Technical Support For help in troubleshooting problems www lego com eng education mindstorms under Support or contact your Lego Education distributor Activities There are many activities and building sets created for LEGO MINDSTORMS FOR SCHOOLS For information on these materials go to www lego com eng education mindstorms and then click on Classroom Solutions Activity ideas are also available online using the Invent amp Investigate database in the ROBOLAB website You can sign in search and download student activity pages and teacher notes for over two dozen activities Go to go to www lego com eng education mindstorms and then click on Classroom Solutions Partner Resources ROBOLAB software was developed as a cooperative effort by LEGO Education Tufts University and National Instruments education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 386 The main website for LEGO Education is www lLego com education Tufts University uses the RCX and ROBOLAB in its own engineering curricula The University also extends its work to K 12 educators through the Center for Engineering Educational Outreach CEEQO For curriculum teacher workshops student camps and ju
143. emarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 170 This command clears ALL events Tasks that are actively monitoring or awaiting for events are Clear not alerted to this fact All Events Example This piece of code empties the data buffer mailbox RCX zeros the and clears all events currently configured on the education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 171 Ed Task Priority Use this icon to assign a task priority over other tasks The highest priority is the default 0 The Lowest is 255 An access monitoring command should follow this icon Task Priority Example Fast rising sweep In this program the top task has a higher priority 255 than the lower task 0 When the program is run motor A will turn on in the backward direction If the touch sensor 1S pressed within 8 seconds the motor will then turn on in the forward direction for two seconds and then shut off After 8 seconds total a sound will play education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This p
144. encan 287 Differentiate eeen 335 Ble CF Ody crsceseccsetessncearncmmenae 173 Direct Functions 295 Blue Timer acotenccntetaceasieessachintentie Zi2 Divide ContaineL 216 BP OWI D ieee 343 DOWN an OCTAVE eee 174 Camera Sensor Container 241 Drive And Sing 35 Camera Sensor Equal Fork 99 Drive To BUM eee 31 Camera Sensor Fork 0 85 Drive TO Dark essees 32 Celsius Equal Fork 88 ETE EM NOUC ccccrsccorecuceuescesecsetiers 175 CELSIUS POP Koree 79 Encoder A oossoooooosooressesessrsesssss0 gt 312 Change Motor Speed 2 ENCO Dorce 313 Change Program on RCX 256 INC OCCT Coan S 313 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com PAO 16 End Direct RCX COMMUNT CATION eee 259 End Internet Direct Mode 301 End of WOOD reescccsessesretecnens 124 End Remote Program 260 Evaluate Expression 232 Event FOPK neesessessessssssssssessess 100 Event Landing 135 Event Register Container 239 Event State Container 240 Poo eE 133 ap 410 Ge Ci Uae ne 326 Extract PANG eenccssinsiise 349 Fahren heit Equal Fork 90 Fahrenheit Fork 81 Fill Container 212 Fill Container With Variable eseese 225 Fill Mail gt Ren ree nn nee ee 261 Fill
145. engineer ing com 109 a Loop While Light Loop While Light Sensor is Less Sensor is Greater Than Than Use these to start a loop while the light sensor value 1s Less than or greater than a certain number The loop will end when the light sensor value goes above Less Than icon or below Greater Than icon that number With respect to the Less Than icon if the light sensor value is above that number when the program reaches this command it will skip the loop With respect to the Greater Than icon if the light sensor value 1s below that number when the program reaches this command it will skip the loop An End of Loop icon is needed somewhere after each icon Example This piece of code starts a loop that would continuously play the note C and a rest until the light sensor value became 55 the default or higher education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 110 aie Loop While Loop While Container is Less Container is Greater Than Use these to start a loop while the container value is less than or greater than a certain number The loop will end when the container value gets to that number or above Less Than icon or to that number and below Greater Than icon If the container value is above
146. engineer ing com re ae ae gt oe eee 67 PAY SLT eee eee 34 Oy ene ne eee eee 18 SOD aliea 18 STOD Doere 18 EOP Ceran E 18 Stop Event Monitoring 134 Stop LOO STNG siecciteeee te ecesceacee 190 StOD OUT OU Sieccyeeeeee sess 20 SLOD TASKS Repent ne 68 Task Priori Uy eccee eet tacetetierascs 171 Task SILT aissectesdstintsoomersicanaiiens 67 Temp C Container aaae 219 Temp F Container aaaeeeaa 220 Temperature Container TempPro LogIT 00000000000 247 Temperature Sensor Fork 87 TIPO SIVO UG ssiccccdncesocasaatceantncraeeassanes 332 TIME oeer E ENE 224 Timer Equal Fork 89 Timer FOTK lt itcccctstesivtastedaccetudatanies 80 Timer Value Container 223 Touch and Release Container PETE aunt EEE EEEE 235 Touch and Release Equal POT E re rT E A 92 Touch and Release Fork 83 Touch Container 00 217 Touch Sampling ee 215 Touch Sensor FOrk 71 Troubleshooting ccccccccsssseeeeeeees 388 TUT e E 28 Turn Outputs ON 24 Turn RCX Power OfF 257 Two BUTTON aeeessssseenssssseessssseeen 33 Unmute SOund cc cccccceeeeees 263 Up an OCtAVE 2 eeeeeeeteeeees 174 WOO ag Dae Aexsccssuthstastevanensie tt 341 UD ee nn ne 364 Value OT deesiessseccccesnseccessiesas 281 284 Value of Battery 278 Value of Blue Container 281 Value of Blue Data Set 286 Value of Blue Duration 292 Value of Blue Event
147. ensor on Port 1 It then plays a sound and displays the value of the red container on the RCX education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 281 Value of Value of Value of Red Container Blue Container Yellow Container Use these modifiers to use the value of the red blue and yellow containers Example This piece of code fills the Red Container with the value of the touch sensor A sound is played and the value of the red container is shown on the RCX If the value of the touch sensor was 1 meaning it was pressed in the RCX would read 1 Use this modifier to generate a random number from 0 8 Number Example This piece of code will fill the Red Container with a random number from 0 8 The RCX will then play a sound and display the value of the red container on its screen education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 282 The value in the container specified Container 1S used to choose a container Value of and the value in that container is passed Container
148. ent above 80 F from port one This command must appear before the Begin Monitoring command in your program You can string ina yellow blue red or generic modifier to have several events You can also string in an event source source of information such as sensor values of ports 1 2 amp 3 container values or mail values Example This piece of code sets up a blue event that is triggered when the temperature value goes above the threshold in Fahrenheit The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the temperature value goes above the threshold This will force the program out of the jump sequence and make it land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 142 This command sets up an event to occur when the value of the temperature sensor goes below the Set Up threshold in Celsius The threshold can be Decrease modified with an event modifier The default is in Temp a red event that waits for a temperature C reading below 30 C from port one This command Event must appear before the Begin Monitoring command in your program You can string ina yellow blue red or generic modifier to have several
149. entation and Support are http www Llegoengineering com and http www Lego com education These sites are a great place to visit for up to the minute patches new features additions and tutorials Both sites also maintain a Large number of links to curriculum resources activity databases and information on classroom materials The Lego Users Group Network LUGNET at www Lugnet com not officially supported by LEGO also provides a great resource for discussing ROBOLAB and other LEGO issues and locating additional information education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com TABLE OF CONTENTS Preface Getting Help with ROBOLAB 2 Help in ROBOLAB ardraws damada imak a mi bo ore a eG Gee Go eae ee 3 ROBULAB WED STLGS 2 660245 4546 4065404680508 i 46 o622664 45484 6 TABLE OF CONTENTS 2 uec4 ecaccaatusagdasatedacerates seas ateads 7 1 About ROBOLAB aaae 9 1 About ROBOLAB ee eee nee 9 Low Entry High Ceiling ee ee ene 9 ROBOLAB and LabVIEW ee ee 10 2 Programming Icons and Examples 0000008 15 Basle OULDUCS t5esnnancacteeae eee esses eaeeeeaeeeeeueasn es 16 BONN TONS eaer ESEESE EEEIEE cue eaaa eae ee se ee eee 4 28 WOlL POLS saarke
150. er Than 131 Loop While Voltage Sensor tS Less Walle eect 131 LOOD en a E 105 LUFCA sao saosecnceseceseSeeccecareeaencnteeiedesebe acs 29 Lux Sensor Container 251 Mail Container ee 222 Mailbox Equal Fork 90 Mailbox FOPK i e ee cceeeeees 82 MAX TMUML cece eeecccesecceeecceneeees 336 Sas g enna ee ee ne E 336 Memory Map cxasscuccseneranienensndwesecncnnies 296 N o N 337 MWOCUIICT Ssscasicssse cen tnasasGessarexeicsavesinavdes 264 Motor A Forward eee 17 Motor A R VEPse uu eee 17 Motor B Forward uuu eee 17 Motor B Reverse uu ee 17 Motor C Forward 17 Motor C Reverse sess 17 Motor Forward essees 21 Motor Forward or Back 25 Motor Random 22 Motor ReverfSe eesse 21 Multiply to Container 215 IVS 1G E EET EA 172 Mute Sound eesessssesssseesssseersss 262 NXT Sound Sensor Fork 73 NXT Touch And Release Fork EIEE EE EEA ET 78 NXT Change VeW eesse 312 NXT Clear 316 322 NAT TOR eriin EEEn Ea 77 NXT Distance Sensor Fork A A A A EEE A 74 NXT Distance Containe 228 NXT Draw Bitmap ee 323 NXT Draw Line 319 NXT Draw Pixel eee 317 NXT Draw RectangLe 318 NXT Erase Rectangle 325 NXT Expanded Formatted Text EEEE ae soo saeco E sees 324 NXT Initialize Clicks Sensor Logging 000000 184 NXT Initialize Distance Sensor LOgging ee 182 education LEGO the LEGO logo and MINDSTORMS are trademarks of the
151. er rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineering com 69 Use this to define a subroutine This does NOT Start the subroutine Each subroutine needs its own end stoplight icon The main task Create Subroutine will continue running by itself until a Run Subcommand is reached Example This piece of code turns on motor A After 4 seconds it plays 3 notes and then turns off the motor T Use this to start a subroutine You must define the subroutine before using this Start Subroutine SN 3 Example This piece of code turns on motor A After 4 seconds it plays 3 notes and then turns off the motor a education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 70 Use this in direct mode ONLY Use this icon to Delete clear the RCX of any subroutines it previously Subroutine ad Example This piece of code clears the RCX of any subroutines and then turns on motor A for 2 seconds and turns it off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 71
152. eshold can be modified with an event modifier The default is a red event that waits for a red container value equal to or less than 1 from port one This command must appear before the Begin Monitoring command in your program You can string ina yellow blue red or generic modifier to have several events You can also string in an event source source of information such as sensor values of ports 1 2 amp 3 container values or mail values Decrease in Container Event Example This piece of code sets up a generic event that is triggered when the red container value goes below the threshold The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the red container value goes below the threshold This will force the program out of the jump sequence and make it land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 166 This command sets up an event to occur when the value of the sensor goes above the threshold The Set threshold can be modified with an event modifier ceneri The default is a red event that waits for a Up Event sensor value greater than 2V from port one This command must appear before the Beg
153. essed the RCX will play a noise and turn off Lamp B Then both tasks will be restarted from the task split If the touch sensor is pressed within 6 seconds both tasks will be stopped and education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 68 the program ends Use this in direct mode ONLY Use this icon to FT clear the RCX of any tasks it previously had The Delete A Tasks Task Number modifier is only necessary if you want to delete only a certain task and not all tasks Example This piece of code deletes all tasks then turns on motor A for 2 seconds and turns it off Use this to stop tasks that may still be in progress The Task Number modifier is only necessary if you want to stop a certain task and not all tasks Example This piece of code turns on motor A and lamp B If 6 seconds pass and the touch sensor has not been pressed the RCX will play a noise and turn off lamp B Then both tasks will be restarted from the task split If the touch sensor is pressed within 6 seconds both tasks will be stopped and the program ends LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL oth
154. event source source of information such as sensor values of ports 1 2 amp 3 container values or mail values Example This piece of code sets up a red event that is triggered when the touch sensor is pressed The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the touch sensor is pushed in This will force the program out of the jump sequence and make it land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com Lod This command sets up an event to occur when the touch sensor is pressed and released The default waits for a touch sensor pressed Released connected to port one This command must appear Event before the Begin Monitoring command in your program You can string in a yellow blue red or generic modifier to have several events You can also string in an event source source of information such as sensor values of ports 1 2 amp 3 container values or mail values Example This piece of code sets up a blue event that is triggered when the touch sensor is released The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the touch sen
155. f the sound sensor on port 2 and place it into the blue container and use that value as the power level for motor A This code will make the NXT move quickly when it hears a sound education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com NXT M Angle Conta 231 Use this command to fill a container with the value of the NXT angle sensor The default is to set the Red Container to the value of the otor NXT Light sensor on port A In your program be l sure to specify what port your NXT angle sensor iner is connected to with a modifier Modifiers for the NXT angle sensors are found in the NXT commands menu Example This piece of code initializes the NXT angle sensor on port A It then enters a jump where it will continuously take the value of the angle sensor on port A and place it into the yellow container The absolute value of the yellow container is placed in the red container which is then multiplied by 10 This value is used as the frequency for a sixteenth note This code turns the NXT rotation sensor into a musical instrument education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights
156. for 8 seconds LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 85 Use this fork if you want to take different l courses of action based on the value of the sa ar Camera Camera sensor A fork merge is required at some Sensor point after this icon Fork Example This piece of code would turn on motor A for 4 seconds then turn it off The direction of the motor is determined by the value of the camera sensor If the camera value is over 55 the default the motor goes forward Otherwise the motor goes in the reverse direction Use this if you want different courses of action to be decided on randomly A fork merge is required at some point following this icon This piece of code would turn on motor A for 4 seconds The direction would be decided on randomly education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 86 ALWAYS needed at the end of a fork to merge two branches back together This piece of code would turn on motor A for 4 seconds The direction would be decided on randomly es
157. g in an event source source of Information such as sensor values of ports 1 2 amp 3 container values or mail values Example This piece of code sets up a blue event that is triggered when the rotation value goes above the threshold The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the rotation value goes above the threshold This will force the program out of the jump sequence and make it land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com Ss NXT Set up Pressed Event Example Los This command sets up an event to occur when the NXT touch sensor is pressed The default waits for a touch sensor pressed connected to port one This command must appear before the Begin Monitoring command in your program You can string in a yellow blue red or generic modifier to have several events You can also string in an event source source of information such as sensor values of ports 1 2 and 3 container values or mail values This piece of code sets up a red event that is triggered when the touch sensor is pressed The Monitor Event icon begins monitoring for such an event to occur A sound w
158. ght Until sensor reading Therefore the reading must begin Dark or rise above the cutoff before an event can be triggered by the drop in Light sensor reading In any behavior you can modify the code to fit your needs Example This program uses an event to trigger the end of the song A light sensor event is set up as the red event and is looking for the light sensor reading to fall below 55 Next the program begins monitoring for the red event The red scroll is played in a forever loop When the light sensor reading falls below 55 the event will be triggered ending the program and the song education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com Sampl Light Samp 1 37 This behavior is Sample Light Use this to behavior to collect Light sensor data In any behavior you can modify the code to fit your needs e Example This program initializes light sensor data logging then logs data every 0 1 seconds This continues until 50 data points have been collected then data logging stops This behavior is Sample and Drive Use this to behavior to collect light sensor data while e driving This behavior is written for a two motor And Drive car In any behavior you can modify the code to fit your needs
159. gineer ing com 284 Q Value of Value of Value of Yellow Red Timer Blue Timer Timer Use this modifier to use the value of the red blue and yellow timers Example This piece of code zeroes the Red Timer and then waits for 10 seconds The value of the Red Timer is put into the Red Container and then displayed on the RCX education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 285 a Use this modifier to use the value of the mail in EZY the mailbox Value of Mail Example This piece of code will fill the Red Container with the value of the mailbox The RCX will then play a sound and display the value of the red container on its screen Use this modifier to use the value of the red 01 timer in thousandths of a second Value of Red Timer 001 Example This piece of code zeroes the Red Timer and then waits for the touch sensor to be pressed The value of the Red Timer in thousandths of a second is put into the Blue Container and then displayed on the RCX to 3 decimal places education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MIND
160. gineer ing com 393 My program should run two motors but Motor B never turns on Ie mah J Sample Problem Code Motor B is programmed to run as a Subroutine It will not turn on until you tell it to Insert the Subroutine icon into the top string when you want the motor to turn on see ma Cea eee Solution education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 394 Tips and Tricks Using the Space Bar to Switch between Tools To quickly change between the Position Size Select tool and the Connect Wire tool press the Space Bar on the keyboard You can even do this when the Tools Palette 1s not visible Auto Wiring and the Space Bar Once you have placed an item in your program you can reactivate auto wiring by selecting the item and pressing the space bar eco education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineer ing com 395 Using the Tab Key to Switch between Tools Use the Tab Key to Switch between the four most commonly used tools Operate Value Posit
161. h Sensor Example This piece of code resets the touch sensor then turns on motor A When the touch sensor is pressed motor A is shut off This program could run without the reset however the reset works to ensure accurate touch sensor data Use this to reset the click count sensor Helpful if taking clicks data Clicks Sensor Example This piece of code zeros the clicks sensor and then starts a loop that would continuously play the note C and a rest until the number of clicks was 10 the default education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineer ing com t99 ot Use this to reset the touch and release a sensor Helpful if taking touch and release Zero Touch data and Release Sensor Example This piece of code turns on motor A for 10 seconds and then shuts it off If after 10 seconds the touch sensor has been touched and released more than 10 times the default it plays a sound Use this to reset the light sensor Helpful if taking light sensor data Light Sensor Example This piece of code resets the light sensor and then logs 10 data points education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopi
162. han 2V the default When the reading goes above this the Loop will stop LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com te HLS gt Loop While Loop While Humidity is Less Humidity is Than Greater Than Use these to start a Loop while the value of the humidity sensor adapter LogIT is less or greater than some number The Loop will stop when the value goes above Less Than icon or below Greater Than icon that number An End of Loop icon is needed somewhere after each icon Example This piece of code will start a loop that plays notes C and D continuously while the value of the humidity sensor adapter is less than 50 the default When the reading goes above this the Loop will stop education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 126 Fe Fe La La Loop While pH is Loop While pH is Less Than Greater Than Use these to start a loop while the value of the pH sensor adapter LogIT is less than or greater than some number The loop will stop when the value goes a
163. has been designed to support the widest audience of users possible While the majority of the features are configured to make it easy for the majority of users to work with many elements of the software can be customized or altered by advanced users by editing text files or writing some code These alterations range from the very Simple Like changing ROBOLAB to use another LEGO interface by default to the creation of custom sensors and palettes education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 36 7 4 1 Editing the Default prf file The Default prf file is a text file that holds preferences for the copy of ROBOLAB It contains the information on which port is being used for communication the path for Saving program data and many other items The file is created the first time ROBOLAB is run after a new install if you upgrade an old installation your Default prf file will be preserved and is updated every time ROBOLAB is run The Default prf file is located in different placed depending on your version of ROBOLAB Version 1 0 ROBOLAB gt Vi 1lib gt Splash gt Default prf Version 1 5 2 0 ROBOLAB gt Default prf Version 2 5 ROBOLAB gt Engine gt Default prf Version 2 5 3 gt The default prf is located in th
164. he camera sensor Use this command to add a data point to a data ee set MUST have both Initialize Logging and Start Write Logging commands before this command Data Point to Data Set Example This piece of code would log rotation sensor data until the light sensor reading increases by 5 It would then add the light sensor reading to the data set and stop logging data LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 189 Use this to start taking data points There MUST be an initialize command before this Start Data Logg Start Data Loggi with Click Ng Example This piece of code resets the light sensor and then logs 10 light data points Use this command to log click data along with another type of data An Initialize Logging Command must come before this icon This command ng WILL start logging data S Example This piece of code would log rotation data with clicks for 10 seconds and then stop LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 190 Use this to stop taking da
165. he bitwise operation is 1 5 0101 1 0001 1 0001 ai This command ORs a bitwise value to the bitwise va value of the container This is NOT a Boolean OR operation Container Example This piece of code fills the Red Container with a value of 5 It then ORs that number with 1 The resulting number after the bitwise operation is 5 5 0101 1 0001 5 0101 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 214 TE Use this command to put the sign positive or KEF negative into a container The default is to r g Sign put a zero in the Red Container Container Example This piece of code takes the sign of the number you put into the container In this case 2 is put into the Blue Container The RCX will then display 1 If the number was 2 then 1 would be put into the container Use this command to add a value to the current on value of the container The default is to add Add to one to the Red Container Container Example This piece of code fills the Blue Container with a value of 1 It then adds 2 to the Blue Container The value of the Blue Container would then be displayed on the RCX as 3 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group
166. he default is to set the Red Container to the value of the NXT Light NXT light sensor on port 1 In your program be Container sure to specify what port your NXT light sensor is connected to with a modifier Example This piece of code takes the current value of the NXT light sensor on port 4 and places it in the red container That value is then multiplied by 10 and used as the frequency for a quarter note education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 228 Use this command to fill a container with the value of the NXT distance sensor The default NXT is to set the Red Container to the value of the Distance NXT distance sensor on port 1 In your program Container be sure to specify what port your NXT distance sensor is connected to with a modifier Example This piece of code initializes the NXT distance sensor on port 4 It then enters a jump where it will continuously take the value of the distance sensor on port 4 and place it into a container multiply that by 5 and use that value as the power level for motor A This will allow the NXT to follow an object in front of it education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may b
167. he sensor was 10 the RCX would read 10 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 224 Use this command to fill a container with the value of the Timer 01 reading time in hundredths of seconds Container Example This piece of code zeros the red time beeps and then puts the value of the Timer 01 reading in hundredths of seconds into the red container It then shows the value of the red container on the display for 2 seconds In general it takes 100 110 hundreds of a second to play the beep education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 225 Use this command to convert a floating point number into an integer to store ina regular ROBOLAB container Fill Container With Variable Example a a TERESA REN as 3s a raha a aana rate rate rotations 4 This code zeros the rotation sensor on port 1 then it runs motor A forward for 4 seconds and turns off the motor The value of the rotation sensor on port 1 in a container that is named rotations Then
168. his piece of code sets up a blue event that is triggered when the temperature value goes below the threshold in Fahrenheit The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the temperature value goes below the threshold This will force the program out of the jump sequence and make it land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com Set Up Mail Event 144 This command sets up an event to occur when the value of the mail equals 10 The default is a red event that waits for the mail to equal 10 This command must appear before the Begin Monitoring command in your program You can string ina yellow blue red or generic modifier to have several events You can also string in an event source source of information such as sensor values of ports 1 2 amp 3 container values or mail values Example This piece of code sets up a red event that is triggered when the mail value being sent to the RCX equals that of the value of the mailbox The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the value of the mailbox equals the mail the RCX is receivi
169. hts reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 164 This command sets up an event to occur when the value of the container goes above the Set Up threshold The threshold can be modified with inerease an event modifier The default is a red event a that waits for a red container value greater Container than 1 from port one This command must appear Eyent before the Begin Monitoring command in your program You can string in a yellow blue red or generic modifier to have several events You can also string in an event source source of information such as sensor values of ports 1 2 amp 3 container values or mail values Example This piece of code sets up a generic event that is triggered when the red container value goes above the threshold The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the red container value goes above the threshold This will force the program out of the jump sequence and make it land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 165 This command sets up an event to occur when the value of the container goes below the Set Up threshold The thr
170. hut it off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 44 Use this icon to wait for something to release the touch sensor before moving on to the next Wait for command If the touch sensor is not pressed to begin with the touch sensor must be pressed then Let Go released Example If an IP number was strung onto the Begin direct icon this piece of code would control an RCX in direct mode over the Internet It would turn on motor A on the remote RCX until a touch sensor was released and then turn it off Use this icon to wait for the light reading to gt oe become greater than a certain value before moving Racin or Wait for on to the next command Example This piece of code turns on motor A then waits for the light sensor to read a value greater than 55 the default Then it turns off the motor education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 45 rip Use this icon to wait for the light reading to es become less than a certain value before moving on to the next comma
171. i 328 Zero Temperature C Sensor 200 VELLON rererere E 102 Zero Temperature F Sensor 200 Yellow Bin essees 343 Zero Timer nesses 202 Yellow Container 266 Zero Touch and Release Yellow Data Set ow 273 SONSODL vu cceecccsssccccssscccescceneeecs 199 Yellow Event eee 287 Zero Touch Sensor 198 Yellow Land eee 103 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com
172. ied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineering com T a aed Fill Container TE ABS Container 212 Containers Use this command to fill a container with a value of your choice which can be controlled by a modifier The default is to set the Red Container to a value of 1 Example This piece of code first zeroes the container then fills the Red Container with a value of 2 A sound is played and then the motor is run at the speed of the Red Container which is 2 Use this command to fill a container with the absolute value of a number The default is to put the absolute value of zero into the Red Container Example This piece of code takes absolute value of whatever is put into the container In this case the absolute value of 2 is put into the Blue Container and the RCX will display 2 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 213 H This command ANDs a bitwise value to the CAS bitwise value of the container This is NOT a AND Boolean operation Container Example This piece of code fills the Red Container with a value of 5 It then ANDs that number with 1 The resulting number after t
173. ill be played over and over again until the touch sensor is pushed in This will force the program out of the jump sequence and make it land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com DS NXT Set Up Released Event Example 154 This command sets up an event to occur when the NXT touch sensor is pressed and released The default waits for a touch sensor pressed connected to port one This command must appear before the Begin Monitoring command in your program You can string in a yellow blue red or generic modifier to have several events You can also string in an event source source of information such as sensor values of ports 1 2 and 3 container values or mail values This piece of code sets up a blue event that is triggered when the touch sensor is touched and released The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the touch sensor is pushed in and released This will force the program out of the jump sequence and make it land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page ma
174. in Monitoring command in your program You can string in a yellow blue red or generic modifier to have several events You can also string in an event source source of information such as sensor values of ports 1 2 amp 3 container values or mail values Example This piece of code sets up a generic event that is triggered when the generic sensor value goes above the threshold The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the generic sensor value goes above the threshold This will force the program out of the jump sequence and make it Land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com Set Generic Down Event 16 7 This command sets up an event to occur when the value of the sensor goes below the threshold The threshold can be modified with an event modifier The default 1s a red event that waits for a sensor value equal to or less than 2V from port one This command must appear before the Begin Monitoring command in your program You can String in a yellow blue red or generic modifier to have several events You can also String in an event source source of Information such as sensor v
175. ineering com NXT Write Text 320 This command allows you to write text to the NXT display To create the string to write on the NXT display right click control click for Mac users on the lower right corner and choose create constant To choose the row to display the text right click on the Lower left corner and choose create constant Row is at the top of the screen and row 7 1s at the bottom Example This code clears the display on the NXT and then writes Laura and Erin on row 3 and are awesome on row 4 This will display for 2 seconds before the program ends education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 321 This command allows you to play NXT sound files To specify a file right click control click for Mac users on the lower Left corner and choose create constant You can view the sound files on the NXT by choosing My files Sound files The NXT file extension for NXT sound files is rso Play Sound File Example MOODS PSO This program plays the NXT sound file woops rso education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved
176. ing Command which is where you Event define your lower and upper thresholds Event Sources can come from sensor values from ports 1 2 amp 3 container values mail values and timer values If using a sensor value the sensor Should be zeroed prior to setting up the event Example NIE f 5 m This piece of code defines the thresholds for the Enter Low Event icon It then sets up the red Enter Low Event and begins monitoring The program will play a sound over and over again until the value of the mailbox goes above 10 This event will force the program to the place where the Event Landing icon is Located Make sure you define a lower upper or normal threshold event before you set them up education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 148 This command resets monitoring for an event The default is to reset the red event with the value Race of port 1 Event Sources can come from sensor Event values from ports 1 2 amp 3 container values mail values and timer values Example This piece of code sets up a red event that is triggered when the touch sensor is pressed The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the tou
177. ion Size Select Edit Text and Connect Wire This can also be done while the Tools Palette 1s not visible eco education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineer ing com 396 Creating a Constant Rather than selecting a modifier from Functions Palette you can create modifiers for certain commands Using the Connect Wire tool l Right Click or Apple Click on the connection you want to create a constant for From the menu i eee that appears E E Pha sible Items select Create lee and the Description and Tip Constant Set Break point Create ridtcaator Find ll Instanr es 7 An appropriate constant will be created Immediately after it is create you can type in the value you wish or modify the value later with the Edit Text tool Al Reposition the constant with the Position Size Select cnet h eco education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineer ing com 397 ReLated Web Sites and Resources Aside from the official ROBOLAB www
178. ion can amp ww LEGQengineer ing com 192 Use this command to take humidity data from a humidity sensor adapter LogIT The data is ai alize returned as a percentage between 1 and 100 Humipro Sensor Logging Example This piece of code would take 10 data points from the humidity sensor Use this command to take pH data from the pH sensor LogIT The data is returned as a wea ae number between 1 and 14 pH Sensor Logging Example This piece of code would take 10 data points from the pH sensor LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 193 Use this command to take pressure data from the pressure sensor adapter LogIT The data Taq Pialize 1s returned in kPa Pressure Sensor Logging Example This piece of code would take 10 data points from the pressure sensor Use this command to take sound data from the sound level sensor LogIT The data 1s ARE returned in dB Sound Sensor Logging Example This piece of code would take 10 data points from the sound level sensor LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit w
179. is command sets up an event to occur when the number of clicks equals the clicks threshold The default 1s a red event that waits for 10 clicks Place on port one This command must appear before the wend Begin Monitoring command in your program You can String in a yellow blue red or generic modifier to have several events You can also String in an event source source of information such as sensor values of ports 1 2 amp 3 container values or mail values Example This piece of code sets up a blue event that is triggered when the number of clicks equals the clicks threshold The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the number of clicks equals the clicks threshold This will force the program out of the jump sequence and make it land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com Set Up 151 This command sets up an event to occur when the number of touch and releases equals the touch and release TR threshold The default is a red Touch event that waits for 10 touch and releases on and port one This command must appear before the Release Begin Monitoring command in your program You ca
180. is page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 247 oa Use this command to fill a container with the w value of the temperature sensor adapter The default is to set the Red Container to the value Temperature a a ne of the temperature sensor adapter on port 1 In TempPro your program be sure to specify what port your LogIT temperature sensor adapter is connected to with a modifier Example This piece of code fills the Red Container with the value of the Prolemp sensor A sound is played and the value of the Red Container is shown on the RCX If the value of the Prolemp sensor was 8 the RCX would read 8 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com as Position Container Position LogIT Example 248 Use this command to fill a container with the value of the position sensor adapter The default 1s to set the Red Container to the value of the position sensor adapter on port 1 In your program be sure to specify what port your position sensor adapter 1s connected to with a modifier This piece of code fills the Red Container with the value of the position sensor A sound is played
181. it for Decrease icon or a value of greater than Wait for Increase icon the cutoff humidity percentage before moving on to the next command Example This piece of code would turn on motor A When the sensor reads a value of less than 50 humidity the default motor A would be shut off LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 64 Wait for Decreasing Decreasing pH pH Wait for Position Use these icons to wait until the sensor reads a value of Less than Wait for Decrease or greater than Wait for Increase the cutoff pH before moving on to the next command Example This piece of code would turn on motor A When the sensor reads a value of greater than 7 the default motor A would be shut off y ipi Wait for Position Increase Decrease Use these icons to wait until the sensor reads a value of less than Wait for Position Increase icon or greater than Wait for Position Decrease icon the cutoff position before moving on to the next command Example This piece of code would turn on motor A When the sensor reads a value of less than 180 degrees the default the motor would be shut off LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group
182. k value is less than or greater than a certain number The loop will end when the clock goes above Less Than icon or below Greater Than icon that number An End of Loop icon is needed somewhere after each icon Example This piece of code plays notes C and D continuously until the RCX clock goes above 1 minute the default Then it turns the RCX power off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 117 Loop While NXT Light Loop While NXT Light Sensor is Less Than Sensor is Greater Than Use these to start a loop while the NXT light sensor value is below a certain number The loop will end when the light sensor value goes above that number If the light sensor value is above that number when the program reaches this command it will skip the loop An End of Loop icon is needed somewhere after this icon Example This piece of code starts a loop that would continuously play the note C and a rest until the light sensor value became 50 or higher It would then turn on Motor A for 2 seconds stop Motor A for 1 second and then jump back to the beginning of the code to start again education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may
183. ks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineering com 81 Use this fork if you want to take different 8 courses of action based on a light sensor A fork Light merge is required at some point after this icon Sensor Fork Example This piece of code turns on lamp A for 4 seconds if the light sensor reads a value of below 55 the default Use this fork if you want to take different courses of action based on a temperature sensor A fork merge is required at some point Fahrenheit after this icon Fork Example This piece of code turns on motor A for 4 seconds The direction is determined by the temperature If it reads above 80 degrees the motor will go forward Otherwise it will go in reverse education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 82 Use this fork if you want to take different EE courses of action based on the value of the ea ox mailbox A fork merge is required at some point Fork after this icon Also an empty mailbox command Should be used sometime before this icon Example This piece of code would empty the mailbox Af
184. l lisa castecors chee acteveccectomemvotena 343 Red Container uu ees 266 Red Data SCE wecieccscccdececusvrcsvecus 273 Red EV CN cresesosestecr sw orsseseneancesen onse 287 Red SC Ob eocen 173 Red TIMe rice eee ceecceescceeceeee 272 Redox Sensor Container 253 Remove from Container 215 R GSC dinccvesaveectevedewenesasenedeundeccteseuescoous 198 RESELL EVENT cearense 148 Reset Sensor Ports 0 211 doh Ee ee te eee ene enn eer ee eer 172 Resume Logging 190 REVET S sessessessessesseseeserssrsersers 23 Rotation Sensor Equal Fork E A A T 91 Rotation Sensor Fork 82 Run Program on RCX 251 Sample And Drive 37 Sample Light cseesssseeees 37 Sample One eeessssssssserssssssssssen 274 Sample one minute 274 Sample one tenth sec 274 SAMPLE GIN ae 274 Save BMP essees 353 Save Dat awccecceeccccssseesceeeeee 342 SAVE SOUM enesenn n 356 Select ROT eessen 354 Send Mal berrerai 259 Sensor Definition Files 372 SEU DVSD LAY oeira 255 Set Generic Down Event 167 Set Generic Up Event 166 Set modifer value 304 Set RCX Powerdown Time 260 Set RCX Tower Power 297 Set Up Clicks Event 150 Set Up Dark Event 139 Set Up Decrease in Container Event 00000 0 165 Set Up Decrease in Rotation a Cod ee ee ee 163 Set Up Decrease in Temp C Event 404 Set Up Decrease
185. l to use before any of the other NXT display commands NXT Clear Display Example This code clears the display on the NXT and then writes Laura and Erin on row 3 and are awesome on row 4 This will display for 2 seconds before the program ends education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com This command allows you to draw darken a pixel T on the NXT display To locate the pixel you need TET to give coordinates for its x y position on the NXT display The display s dimensions are 100 by 64 Position 0 0 is in the lower left corner of NXT Draw the NXT display To provide the x and y Pixel locations right click control click for Mac users on the lower left and right corners and choose create constant or get numeric constants from the modifiers menu Also you can use the value of sensors or containers as coordinates Example a pa CRA JE This program will create a graph of light sensor data on the NXT display First it clears the display empties the red container and initializes the NXT light sensor on port 3 Next it enters a Loop which draws a pixel on the NXT display with the value of the red container as the X coordinate and the value of the light sensor as the Y coordinate It
186. layed on the RCX s LCD panel education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 364 3 3 User Data in ROBOLAB ROBOLAB user data and examples are stored ina set of folders that allows the user to organize their information and the ROBOLAB software access customized settings and programs User Data Program Vault All Versions of ROBOLAB The Program Vault contains programs created in the Programmer section of ROBOLAB in Pilot and Inventor Programs are stored in the My Programs folder of the section and level they were created i e A level 3 Inventor Program would be stored in Program Vault gt Inventor gt My Programs gt Level 3 gt myprogram vi7 Examples that correspond to different LEGO sets are also stored in the Program Vault under the corresponding theme names Investigator Themes ROBOLAB 2 0 and higher Investigator Themes contains the programs and data created in the Investigator section of ROBOLAB The folder contains two sub folders Examples and My Projects Examples contains the Locked sample programs that ROBOLAB Ships with My Projects is where user programs are stored HTML ROBOLAB 2 0 and higher Within Investigator users can publish their project as a set of web pages with pictures of their
187. layed on the front panel using indicators Example This piece of code takes data from the Yellow Bin fits a y AlLnX B Line to the data plots the result in the purple bin and displays the equation of the fit on the front panel To view the original data and the fit data at the Same time use the Compare template in the View and Compare section of Investigator education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com Fit Spline FFT Spectrum 340 Use this command to fit a spline to the desired Data Sets Choose Spline fit to Data Sets to display ONLY the spline fit or choose Original and fitted curve to display both The coefficients and equation string can be displayed on the front panel using indicators Example This piece of code takes data from the Yellow Bin fits a spline to the data plots the result in the purple bin and displays the equation of the fit on the front panel To view the original data and the fit data at the same time use the Compare template in the View and Compare section of Investigator Use this command to find the Power Spectrum of a data set Useful for determining the frequency of a waveform in a data set Example This piece of code takes data from the blue bin finds
188. ld read 8 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 234 a Use this command to fill a container with the oo number of clicks of the touch sensor The Cirks default is to set the Red Container to the Container number of clicks from the touch sensor on port 1 In your program be sure to specify what port your touch sensor is connected to with a modifier Example This piece of code fills the Red Container with the number of clicks of the touch sensor A sound is played and the value of the Red Container is shown on the RCX If the number of clicks was 3 the RCX would read 3 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 235 Use this command to fill a container with the iein number of touch and releases of the touch Touch and sensor The default is to set the Red Release Container to the number of touch and releases Container from the touch sensor on port 1 In your program be sure to specify what port your touch sensor 1s connected to with a modifier Example This piece of
189. llect temperature data in Fahrenheit from the temperature sensor Initialize Temperature Sensor Logging Example This piece of code would take 10 data points from the temperature sensor education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 179 Use this command to collect rotation data from the rotation sensor Data 1S in sixteenths of alize a rotation so a reading of 16 is equal to one Rotation Pe Rotation can either be in either Sensor irection Logging Example This piece of code clears the data memory then logs 500 points of rotation sensor data Use this command to collect data from the de 4 click sensor It might be helpful to zero the Treas ee click sensor at the beginning of the code Click Sensor Logging Example This piece of code zeros the click sensor Then it logs click sensor data for 4 seconds and stops LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 180 Use this command to collect data from the ott touch and release sensor It might be E helpful to zer
190. lock Container Example This piece of code fills the Red Container with the value of the clock A sound is played and the value of the Red Container is shown on the RCX If the value of the clock was 30 minutes the amount of time the RCX was on the RCX would read 30 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 238 K Use this command to fill a container with the result of a mathematical formula The default a 1s to set the Red Container to a value of one Formula l In order to create a string the area where the Container l formula is written you must right click on the lower right hand corner of the icon and click on create constant You can then type in your formula in the pink box Example chit This piece of code fills the Red Container with the value of the light sensor on port 1 It then divides the value of the Red Container by 10 adds 8 4 times 2 and then puts the resulting value into the Red Container This value is then displayed on the RCX education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can
191. m the Administrator menu This should be changed in Select COM port Network Port Specifies the TCP IP port over which Internet commands are sent and received Don t change this number or you will not be able to communicate via the Internet with ROBOLAB software Init each time Allows you to configure the serial port to every time ROBOLAB RCX communication is attempted Mainly a debugging feature for older PC computers and is not used in the Latest versions of ROBOLAB Bytes UpLload The computer sends the information down to the RCX in batches This tag specifies the amount of information in bytes in these batches This number can be decreased if you are having difficulties communicating with the RCX or Increased to make the download speeds faster The larger the batch size the faster the download if the tower and RCX are communicating well If batches have to be resent large batch sizes will slow the communication down Level 3 Steps Specifies the number of steps in Investigator Program Level 3 This number can be increased if you wish to have additional steps in this Pilot like interface Investigator State Specifies the component Programmer or Investigator of ROBOLAB that is Loaded into memory when ROBOLAB first Starts up ID Specifies which mode ROBOLAB is running in O Error this mode creates a text log that can be used to troubleshoot problems 1 Text this mode outputs lists commands in text form In
192. may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 105 Use this to start a loop while the touch sensor is pressed The loop will end when the touch sensor is released If the touch sensor is not While pressed when the program reaches this command it Touch Skips the loop To avoid this add a Wait for Sensor Push icon before this icon An End of Loop icon os 1S needed somewhere after this icon Pushed Example This piece of code would wait until the touch sensor was pushed then start a loop that would continuously play the note C and a rest while the touch sensor remained pushed When the touch sensor was released it would play a sound education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 106 p Use this to start a loop while the touch sensor cam E is NOT being pressed The loop will end when the Loop touch sensor is pressed If the touch sensor is While pressed when the program reaches this command it Touch skips the loop An End of Loop icon is needed ancor somewhere after this icon 1S Pushed Example NXT L While This piece of code would start a loop that would continuously play the note C and
193. motor A then change the RCX display to input 2 Then it will wait for the value of light sensor on port 2 to increase by 5 the default Then the motor will be shut off Prgm Use this to change the number of the program in z the RCX Change Program on RCX Example This piece of code would run program 1 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 257 Use this to turn off the RCX s power Turn RCX Power Of f Example This piece of code would wait for the RCX clock to reach 5 minutes and then it would turn off power to the RCX Use this to run a program Run Program on RCX Example This piece of code would run program 1 LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 258 This sets the value of a container on another RCX to the specified value This 1s similar to the send mail command It is useful if you have multiple values you want to send to another RCX Remote Container Example This piece of code will set the Blue Container on another RCX to 1 the d
194. n evant String in a yellow blue red or generic modifier to have several events You can also string in an event source source of information such as sensor values of ports 1 2 amp 3 container values or mail values Example This piece of code sets up a blue event that is triggered when the number of touch and releases of the touch sensor equals the clicks threshold The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the number of touch and releases of the touch sensor equals the clicks threshold This will force the program out of the jump sequence and make it Land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 152 This command sets up an event to occur when the value of the rotation sensor goes above the Set Up threshold The threshold can be modified with Increase an event modifier The default is a red event a that waits for a rotation reading of 16 Rotation rotation sensor is in 16ths of a rotation Event from port one This command must appear before the Begin Monitoring command in your program You can string ina yellow blue red or generic modifier to have several events You can also strin
195. n integer Non integer results will be truncated the decimal parts of the number will be removed Example This piece of code fills the Blue Container with a value of 1 It then divides the value of the Blue Container by 2 The value of the Blue Container would then be displayed on the RCX as 0 0 5 truncated 0 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com B Touch Container Example 217 Use this command to fill a container with the value of the touch sensor This value will either be a zero or a one The default is to set the Red Container to the value of the touch sensor on port 1 In your program be sure to specify what port your touch sensor is connected to with a modifier This piece of code fills the Red Container with the value of the touch sensor A sound is played and the value of the Red Container is shown on the RCX If the value of the touch sensor was 1 meaning it was pressed in the RCX would read 1 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 218 ta Use thi
196. n sacs aw eee eee nese aaae ue ae nwee ae ee nese aes 39 Tasks amp Subroutines Structures 2 00008 67 FOIF S odere e454 oe eee eee eGo eons eee 4 hoe eee tet ae wee ease 71 IUIOS Geeeeeuseeeee E eeeeee eee eee dees eee ee ee ee esss 102 LOODS gs 54 eee eo pee e eee eee eee oe ee ee Se eee eee eee ee ess 105 EVCINCS 2446 eee os Ge Oe ee eS ee Bee ee Cae ee oe Gee ay 133 TASK PPLORUCY o55 e545 Ses oS oe ee eos oa eee Cee eases 171 MUSIC 24 eo e4Ge nd r eShe ee kOe he nes BONES DESEO EEE eee eeesead 172 NVESTISAUOl 2h2ne ce hsbd he be BbbG RG Be EOSS RO BEE EES RS EAEES 176 Reset geGeeseeoes tees eeeneuseeoeeneeeeeeeneGeescauees Heroes 198 Containers accecceesuctet eect eeeeeesGeasgeecteaetensued 212 RCX CommunicationS ee ee eee 255 MOCGATAIGCrS 2c eeec cere bobs He veh eee Hee hee HE Re Rohe He we DS 264 DITO FUNCTIONS santars beeen abe eee aes a ete ge a eee 295 NCC hINGG Saagieaaes a6 e4en 6s como en ee ade eens abe bea en ae ese 300 PON OAWVCCO serete rrr NERNET 302 Control Lab Interface iiucieascheectivsescisecivesiieeetead 305 NAF COMINS parere iagi penpe rpa ae aeai 310 G COGe perep are ee ae ee eee ae ee ee ee ee ae ee 326 MOLE CIMETA ceeedanva nee de eve ee se eee se eee e ee Ue ee hee ea 345 Ba HOW Oh ened one bee hoe es eb eee eS oe hee ee ease 358 3 1 Using Vision Sensors Outside of Vision Center 359 3 2 Containers in ROBOLAB 2246 soos ous Hew i ee Heo be Eee SG 363 3 3 User Data in ROBOLAB 0
197. n the Red Container Then the red container is multiplied by 10 and that number is used as the frequency of a quarter note education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 312 This command allows you to programmatically CP change views on the NXT display The values of E the NXT screens O standard 1 sensor values 2 motor speeds 3 data log graph To choose a view right click control click for Mac users NXT on the lower right corner and choose create Change constant View Example aernotors This program turns on motor A at power level 3 It then Switches the NXT screen to view the value of the motor speeds and encoders When the encoder on motor A goes above 720 then motor is turned off Use this modifier to indicate you are using the encoder in Motor A This can only be used with the NXT motors Encoder A Example This program turns on motor B and then waits for the NXT encoder in the motor on port B to reach 720 2 rotations at 360 for each rotation Then the motor is turned off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Vi
198. n the Yellow Bin E os Use this command to put to separate plots on the Lz Same graph This is useful for combining data Comb ne averages collected from different sensors or for Bins creating custom views of data Example This piece of code averages all the lines in the Red Bin and averages all the lines in the blue bin It then combines them into one plot that is plotted in the lavender bin education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineering com 328 Use this to combine independent axes or arrays into a graph XY Plot Example This piece of code separates the data in the lavender bin into separate X and Y arrays 10 is added to the Y array and the result is plotted to the lavender bin When viewed in the View and Compare area the lavender bin will have 2 plots the original data and the adjusted data created with the code above N Use this command to put a plot into a bin f i Bin Plots Example This piece of code would take data from the Red Bin fit a line to it and put the plot in the Brown Bin education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserve
199. nd Wait for Dark Example This piece of code turns on motor A then waits for the light sensor to read a value less than 55 the default Then it turns off the motor A Use this icon to wait for the light reading to Te Increase by a certain value before moving to the Wait for ext command Brighter Example This piece of code turns on motor A then waits for the light reading to increase by 5 the default Then it turns off the motor education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com K 46 Use this icon to wait for the light reading to decrease by a certain value before moving to the Wait for next command Darker g h Wait for Example This piece of code turns on motor A then waits for the light reading to decrease by 5 the default Then it turns off the motor Use this icon to wait for a number of rotations or a fraction of a rotation to be completed but do NOT want to reset the rotation sensor to 0 The general wait for Rotation rotation sensor resets to 0 and then waits for w o Reset the cutoff rotation The angle sensor value 1S measured in sixteenths so a reading of 16 1S one rotation Example This piece of code turns on Lamp A waits f
200. ng This will force the program out of the jump sequence and make it Land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 145 This command sets up an event to be triggered when the value of the Event Source goes below the Set Up Lower threshold This command should be followed by the Define Setting Command which is where you Enter l LOW define your lower and upper thresholds Event Event Sources can come from sensor values from ports 1 2 amp 3 container values mail values and timer values If using a sensor value the sensor should be zeroed prior to setting up the event Example This piece of code defines the thresholds for the Enter Low Event icon It then sets up the red Enter Low Event and begins monitoring The program will play a sound over and over again until the value of the mailbox goes below 5 This event will force the program to the place where the Event Landing icon is located Make sure you define a lower upper or normal threshold event before you set them up education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights rese
201. nge from 0 to 255 Value Example This piece of code takes a small gray image and then determines the value of the pixel in the specified position and prints it as a number to the I indicator Images are strings of numbers which represent uz colors put together Use this to turn an image Convert into an array of numbers to Array Example Intensity Graph This piece of code initializes an Internet image takes a green image from a remote camera and converts it to an array which is displayed as an intensity graph on the front panel education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 352 Images are strings of numbers which represent Eg colors put together Use this to turn an array Convert of numbers into an image to Image Example Intensi ty Graph ja This piece of code reads an array from an intensity graph and converts it into an image That image is then saved as a bmp file along the indicated file path Hornig Use this to read a bitmap bmp file and create Liza an image Read BMP Example This piece of code reads a bmp file from the designated file path and converts it to an image It then converts that image into an array which is displayed on the front panel as an in
202. nto the next Louder command Example This piece of code turns on Motors A and C then waits for the volume to increase by 15 in which case Motors A and C reverse It then waits for the volume to decrease by 20 Next it jumps back to the beginning of the program and starts again Use this icon to wait for the volume to decrease by the cutoff value before moving onto the next command NXT Quieter Example This piece of code turns on Motors A and C then waits for the volume to increase by 15 in which case Motors A and C reverse It then waits for the volume to decrease by 20 Next it jumps back to the beginning of the program and starts again education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com NXT Wait for Rotat 56 Use this icon to wait for the NXT angle sensor value to be greater than the value specified before moving on to the next command Ton Example This piece of code turns on Lamp A Once the angle sensor on Port B value reaches 180 degrees one half a rotation the default Lamp A turns off Use this icon to wait for the angle sensor value to be greater than the cutoff value before moving on to the next command The rotation can be either forward or backward Ex
203. o a 2nd Program RCX aS a program there must be a continuous line of site between the 2 RCXs during the download Example This piece of code would download a program containing only the three notes to another RCX The 2nd RCX would NOT play the notes until the Run button was pressed or the program was told to run programmatically education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 260 This icon is used to end the downloading of a program from one RCX to another The commands End that are between this icon and the Start Remote Remote Program icon would be downloaded to a 2nd RCX as Program a program there must be a continuous line of site between the 2 RCXs during the download Example This piece of code would download a program containing only the three notes to another RCX The 2nd RCX would NOT play the notes until the Run button was pressed or the program was told to run programmatically Use this piece of code to change the powerdown z time on the RCX This can also be done with Set RCX the Robolab Administrator Powerdown Time Example This piece of code sets the powerdown time to 10 minutes education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group
204. o the touch and release sensor Touch and at the beginning of the code Release Sensor Logging Example This piece of code zeros the touch and release sensor Then it logs touch and release sensor data for 8 seconds and stops Use this command to initiate data collection from the NXT Light sensor If you do not add a Data Set modifier the data will be collected as the Red Data Set default OY NXT Initialize Light Sensor Logging Example This piece of code initiates light sensor logging on the NXT Light sensor on port 1 It begins data collection logging light sensor data every 1 second to the Red Data Set until it collects 50 data points LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 181 Use this command to initiate data collection from the NXT touch sensor If you do not add a Data Set modifier the data will be collected as the Red Data Set default NXT Initialize Touch Sensor Logging Example This piece of code initiates touch sensor logging on the NXT touch sensor on port 2 It begins data collection logging light sensor data every 1 minute to the Blue Data Set until for 30 minutes education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LE
205. ocated Motor A will then go forward for 2 seconds and then stop education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 162 This command sets up an event to occur when the value of the NXT distance sensor goes below the threshold The threshold can be modified with an NXT Set event modifier The default 1S a red event that Up waits for a distance equal to or below 16 from Decrease port one This command must appear before the In Dista Event Begin Monitoring command in your program You can nce String in a yellow blue red or generic modifier to have several events You can also string in an event source source of Information such as sensor values of ports 1 2 and 3 container values or mail values Example This piece of code sets up a red event that is triggered when the value of the light sensor goes below 15 the distance threshold The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the value of the distance sensor goes below 15 This will force the program out of the jump sequence and make it Land where the event landing is Located Motor A will then go forward for 2 seconds and then stop education LEGO the LEGO logo
206. oder in an NXT motor It might be helpful to zero the NXT angle sensor at the NXT beginning of the code If you do not add a Data Initialize set modifier the data will be collected as the Rotation Red Data Set default Sensor Logging Example a Ao s en This piece of code initiates rotation sensor logging on the NXT angle sensor on motor A It begins data collection logging angle sensor data every 0 1 seconds Motor A and C turn on and continue for 4 seconds Then data collection and the motor stop education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 184 Use this command to initiate data collection from the NXT clicks sensor It might be NXT helpful to zero the NXT clicks sensor at the Initialize beginning of the code If you do not add a Clicks Data Set modifier the data will be collected Sensor as the Red Data Set default Logging Example This piece of code zeros the NXT clicks sensor It then initiates click sensor logging on port 1 It begins data collection Logging clicks sensor data every 0 1 seconds Motor A turns on and continues for 8 seconds Then data collection and Motor A stop education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The L
207. of code would turn on motor D and wait until a touch sensor connected to port 5 was pushed Then motor D would turn off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com Value of Value of Port 1 Port 2 Value of Value of Port 6 Port 7 307 Q Value of Value of Value of Port 3 Port 4 Port 5 Value of Port 8 These are input value modifiers String them onto containers events Example etc This piece of code would turn on motor D wait until the reading on the Light sensor on port 7 increased by 5 then turn off motor D Then it would take the light sensor reading from port 7 and put it in a container education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 308 ALWAYS use this to begin a Control Lab program when not in direct mode You need to string in Begi a number that corresponds to the computer port gin Control the Control Lab interface is connected to Lab Interface Example Beere Pe ieia i m This piece of outputs for 2 seconds and then turn them off code w
208. of the camera sensor is defined by the user in Vision Center Sensor Container Example This piece of code fills the Red Container with the value that 1s returned from the camera and displays it on the RCX In order for this icon to work you must be running Vision Center which can be found under the Project menu on the ROBOLAB toolbar education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 242 t This command sets the container to the value of cS the generic sensor adapter The default is to IT set the value of the generic sensor adapter to Concor the Red Container Container Example This piece of code fills the Red Container with the value of the generic sensor A sound is played and the value of the Red Container is shown on the RCX If the value of the generic sensor was 32 the RCX would read 32 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 243 Use this command to fill a container with the value of the humidity sensor The default is to set the Red Container to the value of the C
209. oftware Step by step directions and more examples and challenges the Using ROBOLAB guide is very useful This book is available through your LEGO Education distributor or in electronic pdf format at the website If you would like to find a distributor visit http www lego com education under Where to Buy Topics in the User s Manual Include e The Pilot and Inventor levels of programming in the PROGRAMMER component of ROBOLAB This is all one needs to program a LEGO robot education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 385 e The INVESTIGATOR component that is used for data logging This section adds scientific investigation to the robot s capabilities allowing the RCX to become a Smart and mobile data logging tool The Investigator component also includes a Journal Area for documenting a project in text and photographs or illustrations and a Publish feature for sharing results e The enhanced Media features the Piano Player and Camera available in ROBOLAB 2 5 1 It also shows how to use some of the higher level capabilities including Vision Center and subroutines Additional Help Resources Developer Support amp Add Ins Visit http www ceeo tufts edu robolabatceeo for the Latest information and h
210. om 75 Use this fork if you want to take different courses of action based on the NXT rotation NXT sensor A fork merge is required at some point Rotation after this icon Sensor Fork Example This program waits 1 second then if the rotation sensor on Port A reads less than 720 degrees Motor A goes forward This continues because of the red jump and land until the rotation sensor reads above 720 degrees in which case it will stop Motor A play a sound and reset the angle sensor to zero education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineering com 76 gt kE Use this fork if you want to take different NXT Light Courses of action based on a light sensor A fork Sensor merge is required at some point after this icon Fork Example This piece of code turns on Motor A for 4 seconds if the NXT Light sensor on Port 2 reads a value of below 55 If the value is greater than 55 a sound is played education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 7 Use this fork if you want to take different
211. ommercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 176 aia Investigator Use this command to collect light data using the Light sensor The data returned is a TREE Ce number between 1 dark and 100 bright Light Sensor Logging Example This piece of code resets the light sensor and then logs 10 light data points education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 17 7 Use this command to collect data from the touch sensor If pressed the sensor returns a 1 Initialize otherwise it returns a zero Touch Sensor Logging Example This piece of code would take 10 data points from the touch sensor education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 178 Use this command to collect temperature data in Celsius from the temperature sensor Initialize Temperature Sensor Logging Example This piece of code resets the temperature sensor and then logs 10 temperature data points Use this command to co
212. on is stored in a variable Use G this modifier as you would use the Red Container to set or manipulate the loop Loop iteration value Counter Container Example This piece of code sets a loop to run for 6 iterations If the touch sensor is pressed the loop iteration is set to zero and therefore the loops stops running education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 294 The loop iteration is stored in a variable Use lt i this modifier as you would use the Red Container Value to view the loop iteration Value Of value Loop Counter Container Example This piece of code sets a loop to iterate 4 times The value of the loop iteration is wired into the Play Sound icon which plays different sounds depending which number 1S wired into it As the Loop iteration changes different sounds are played Play Sound does not have a sound for the state so the sound for the 1 state is played twice education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 295 Direct Functions These two icons are
213. ont i F education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineering com 379 like The upper long and thin box is the panel Drag it up and make it bigger so that you can see both a panel and a diagram Next add on the icon that finds the average area and you can add an indicator on the front panel to show that area The easiest way to do this is to right click or click while holding the apple key down on the lower right corner of the icon and select Create an Indicator The help menu Ctrl H would tell you that the lower left corner of the icon gives the calculated area You can move your indicator around on the panel and getting the paint tool hit the tab key a few times to get it will allow you to change the color of the panel as well The completed customized palette should look like Area 1260 8750 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 380 For instance if you had measured the oscillations of a pendulum by putting a Light sensor on the RCX and then Swinging the whole thing you would
214. ontainer humidity sensor on port 1 In your program be HumiPro Sure to specify what port your humidity sensor LogIT 1S connected to with a modifier Example This piece of code fills the Red Container with the value of the humidity sensor A sound is played and the value of the Red Container is shown on the RCX If the value of the humidity sensor was 32 the RCX would read 32 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 244 oa Use this command to fill a container with the w value of the pH sensor The default is to set pH Container the Red Container to the value of the pH pH LogIT sensor on port 1 In your program be sure to specify what port your pH sensor is connected to with a modifier Example This piece of code fills the Red Container with the value of the pH sensor A sound is played and the value of the Red Container is shown on the RCX If the value of the pH sensor was 8 the RCX would read 8 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 245 Use this command to fill a con
215. or 1 rotation a reading of 16 the default from the sensor then turns Lamp A off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 47 Use this icon to wait for the angle sensor value to be greater than the cutoff value before moving on to the next command The rotation can be either forward or backward The default is 180 degrees or half a rotation Example This piece of code turns on lamp A Once the angle sensor reads a value of greater than 180 degrees the default lamp A turns off nia Use this icon to wait for the angle sensor value al to be greater than the value specified before h a Wait for moving on to the next command The angle sensor Rotation value 1S measured in sixteenths so a reading of 16 is one rotation Example This piece of code turns on lamp A Once the angle sensor value reaches 16 or one rotation the default lamp A turns off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 48 wy Use this icon to wait for something to push in the touch sensor
216. or is controlled by one touch sensor in a separate task Each task consists of a forever loop and a touch sensor fork When a touch sensor is pressed that motor turns on in the forward direction So when both touch sensors are pressed both motors go forward causing the car to drive straight When neither touch sensor is pressed both motors are Stopped causing the car to stay still If only touch sensor 1 is pressed then only motor A is on causing the car to turn education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com Stay Still 34 This behavior is Stay Still It makes the car Stay in the same place If you push it it will return to the original spot This behavior is written for a one motor car with an angle sensor attached to a second set of wheels In any behavior you can modify the code to fit your needs Example This program begins by resetting the angle sensor which sets the original spot the car will try to return to Then a forever Loop begins In this loop The value of the rotation sensor is multiplied by 5 and this value is used for motor speed In this way the car will return to the original spot 0 rotations moving at speed 0 or stopped if it is pushed If you find that your car runs away from
217. orials on using ROBOLAB The web component is a continually growing environment where we update and add new material and sample curriculum all the time This guide is designed to serve as an extended reference resource for the ROBOLAB software It aims to supplement the other support and help components that already exist With nearly 300 pages of information the ROBOLAB Reference Guide is best used as an interactive electronic document from which pages or sections can be printed if needed The Guide is a dynamic project continually growing and being updated The most current version is available for download at www Legoengineering com education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com Help in ROBOLAB The first place to look for help is within ROBOLAB All versions of ROBOLAB have context help for the software environment Help can be turned on and off using the Help Button or via keyboard shortcuts CTRL H Context Help Box Click here to download this program into the RCH Help Button After turning on the help placing your mouse over any object in a window or icon the context help will present a description of the item or directions on how to use it This type of help can be useful for learning how to use the
218. orward direction Use the ports modifier to choose which motors to turn on Without a modifier this command will turn on all ports Use the power level modifier to change how fast the motor spins from 1 slow to 5 fast Without a modifier the power level will be 5 fast Example This piece of code would turn on motors connected to ports A and B in the forward direction After 4 seconds it would turn them off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 22 Use this icon when you want the motor to turn on Motor in a random direction This icon DOES turn the Random motor on The default is to turn on all ports to power level 5 Example This piece of code turns motor A on in a random direction The motor runs for 10 seconds and then stops Use this icon when you want to change or assign motor speeds This does NOT turn the motor on It needs to be used in combination with a command that starts the motor or at a point in your program where the motor is already on Example This piece of code turns on motor A in the forward direction at full power for one second then it changes to power level 3 for ten seconds and turns off education LEGO the LEGO logo and MINDSTORMS are
219. ould turn on motors connected to all 8 ALWAYS use this to begin a direct mode Control Lab program You need to string in a number that Begin corresponds to the computer port the Control Lab Direct interface is connected to Mode Example This piece of code would wait until the reading on the light sensor attached to port 4 increased by 5 Then it would display the value of port 4 on the control panel education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 309 ALWAYS use this to end a direct mode Control Lab program Each task will need its own End icon This piece of code would wait until the reading on the light sensor attached to port 4 increased by 5 Then it would display the value of port 4 on the control panel Use this to read a value during direct mode ae while using the Control Lab interface Poll Interface Box Example This piece of code would wait until the reading on the light sensor attached to port 4 increased by 5 Then it would display the value of port 4 on the control panel education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit
220. over again until the red timer value goes above the threshold This will force the program out of the jump sequence and make it land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com Defin Event 169 This command is used for defining the thresholds for the Enter Low Normal and High Events commands If a certain specification is not being j used it will be ignored For example the upper threshold will be ignored if you only set up an Enter Low Event command You can string in an event modifier to determine what event you are dealing with Also you can string in a duration modifier which sets a limit of the length of time a condition must be occurring to count as an event Example i ae L E m This piece of code defines the thresholds for the Enter Low Event icon It then sets up the red Enter Low Event and begins monitoring The program will play a sound over and over again until the value of the mailbox goes above 10 or below 5 This event will force the program to the place where the Event Landing Icon is located Make sure you define a lower upper or normal threshold event before you set them up education LEGO the LEGO logo and MINDSTORMS are trad
221. p will stop when the value goes above Less Than icon or below Greater Than icon that number An End of Loop icon is needed somewhere after both icons Example This piece of code will start a loop that plays notes C and D continuously while the value of the voltmeter is less than 2V the default When the reading goes above this the loop will stop that is going to be repeated a certain number of times An End of Forever Loop icon is needed somewhere after this icon ia Use this piece of code to start a forever loop RCX Loop Forever Example This piece of code would turn lamp A on for 2 seconds and then off for 2 seconds and repeat this 9 more times In total the Light blinks 10 times education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com t32 ALWAYS end loops with this icon 3 RCX End of Loop Forever Example This piece of code would turn lamp A on for 2 seconds and then off for 2 seconds and repeat this 9 more times In total the light blinks 10 times education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com
222. pixel in the specified position and prints it as a number to the I indicator Esa Use this to extract a single plane red green nra blue or grayscale from a color image Extract Plane Example This piece of code takes a medium color image and extracts the blue plane from it education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 350 f Use this to convert your image to a picture you can place on the control panel etc Convert to Picture Example This piece of code initializes a medium image snaps a red image and converts that image to a picture to be displayed on the control panel Use this to shrink image Go from medium size to small size Shrink Image Example This piece of code initializes a medium image takes a blue Image and shrinks it to a small image education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 351 mad Use this to determine the color of an individual pixel If image is black and white the number Get will be 0 or 1 If image is color the number Pixel will ra
223. r non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineer ing com 14 At the Inventor Level and the higher programming levels of Investigator users are actually doing modified LabVIEW programming The bottom purple window that appears is actually a LabVIEW diagram ROBOLAB Untitled 1 vi AA wantor Diagram When the run button is pressed the code is compiled and sent to the RCX or NXT A window will pop up asking if you are using the RCX the NXT or the Control Lab The majority of ROBOLAB programming doesn t require the front panel so it is presented in a smaller format and used to display additional directions and information like the Welcome to Inventor message The similarities between the upper levels of ROBOLAB and LabVIEW mean that ROBOLAB users have much of the power of LabVIEW at their disposal allowing them to perform nearly any task or challenge they can conceive It also means that users who wish to go further with programming have a solid foundation in this type of graphical programming environment and can easily transition to using LabVIEW Ry education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineer ing com 15 2
224. r rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 208 a Use this to reset the NXT distance sensor Fa Helpful if taking distance data NXT Zero Distance Sensor Example This piece of code resets the NXT distance sensor on port 1 and then initiates distance sensor logging on the NXT distance sensor on port 1 It begins data collection logging distance sensor data every 0 1 seconds Motors A and C turn on After 4 seconds data collection and the motors stop education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 209 Use this to reset the NXT sound sensor Helpful 1f taking sound data NXT Zero Sound Sensor Example This piece of code resets the NXT sound sensor on port 2 then initiates sound sensor logging on the NXT sound sensor on port 2 It begins data collection logging sound sensor data every 0 1 seconds for 30 seconds education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 210 Use this to reset the NXT angle sensor This is useful at the beginning of any
225. reach a certain time value in minutes before Wait for moving on to the next command Useful if you do Clock not want the RCX to stay on too long to conserve batteries Example This piece of code turns on lamp A and waits for the RCX clock to reach 1 minute the default then turns off the Lamp LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 61 Use this icon to wait until the clock reaches a H certain time measured in tenths of seconds before moving on to the next command Always use Wait for ti q to thi d aer a zero timer command prior to this command Example This program zeros the red timer and turns on motor A Then it waits for the red timer to reach 1 second the default after which it stops motor A Use this icon to wait until the timer read in Wait hundredths of seconds reaches a certain time for before moving on to the next command Always use Timer a zero timer command prior to this command Example This program zeros the red timer then it waits for the red timer to reach 600 hundredths of seconds after which it beeps education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial
226. rees Celsius the default When the reading goes above this the loop will stop education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 130 ot ra ac Ln Loop While Loop While Position is Less Position is Than Greater Than Use these icons to start a Loop while the value of the position sensor adapter LogIT is less than or greater than some number The Loop will stop when the value goes above Less Than icon or below Greater Than icon that number An End of Loop icon is needed somewhere after this icon Example This piece of code will start a loop that plays notes C and D continuously while the value of the position sensor adapter is less than 180 degrees the default When the reading goes above this the Loop will stop education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com Tig i i Loop While Voltage Loop While Voltage Sensor is Less Sensor is Greater Than Than Use these icons to start a loop while the value of the voltmeter LogIT is less than or greater than some number The loo
227. rk merge is required Sensor at some point after this icon Fork Example This piece of code checks the volume of a room as read by the NXT sound sensor If the volume is greater than 40 a sound is played it is less than 40 Motor A runs in reverse for two seconds It ther jumps back to the beginning of the code to start again education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 74 gt ee Use this fork if you want to take different courses of action based on distance from the NXT sensor in cm as read by the NXT distance Distance sensor fork A fork merge is required at some censor point after this icon Fork Example This piece of code runs Motor A in reverse if the distance sensor reads a value of less than 10 It continues going backward because of the red jump and land until the distance sensor reads a value greater than 10 in which case it will run Motor A forward until a distance of 10 is reached again This process continues over and over education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering c
228. rn on motor A for a random amount of time between 0 and 5 seconds and then turn it off Use this if you want to wait a certain number ii of thousandths of seconds before moving on to Wait for the next command Useful to choose duration n of motor and lamp activity thousandths of a second Example This piece of code would turn on Motor A and C for a the number of thousandths of seconds specified on the control panel then run Motor A forward and B backward until a touch sensor was pressed in which case both motors would turn off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 41 Use this if you want to wait a certain number OO of hundredths of seconds before moving on to Wai FOr N the next command Useful to choose duration hundredths of motor and lamp activity of a second Example This piece of code would turn on motor A for the number of hundredths of seconds specified on the control panel and then turn it off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 42 Use
229. roup 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 265 Input 1 Input 2 Input 3 Use these modifiers to indicate to which ports your input device 1s connected Example This piece of code runs motor A forward at power level one until the touch sensor that is connected to Port 1 is pressed in It then plays a sound and stops motor A education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 266 Hints The numeric constant is used to modify many icons Use the text tool to edit the number Example This piece of code runs motor A and motor C forward for 1 5 seconds then the motors are turned off Q Q Red Blue Container Yellow Container Container Use these modifiers to indicate that you are using values associated with the specific Containers Example This piece of code fills the Red Container with the value of the touch sensor A sound is played and the value of the red container is shown on the RCX If the value of the touch sensor was 1 meaning it was pressed in the RCX would read 1 LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group
230. rs ROBOLAB for LabVIEW was developed by Tufts University with the Support of the National Science Foundation and the cooperation of Lego Education and National Instruments ROBOLAB for LabVIEW adds the ability to interface with numerous LEGO products including the RCX LEGO Camera and Control Lab Interface to LabVIEW Student Edition It also provides an Interaction tutorial that provides instruction on learning basic LabVIEW programming as well as data acquisition and analysis techniques For more information on using ROBOLAB for Labview supporting curriculum and additional materials visit http wwww ceeo tufts edu ROBOLAB for LabVIEW is based upon work supported by the National Science Foundation under Grant No 9950741 Any opinions findings and conclusions or recommendations expressed in this material are those of the author s and do not necessarily reflect the views of the National Science Foundation NSF education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 399 Index ABS Container eesssssssssssssssssss 212 Change View on RC X 256 Acceleration Sensor Clear All Events 0000000000 170 CONE dio ere 250 Clear Data Logging Memory Add to Container DAG a E E EE ETE 203 211 ALL BIN
231. rved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 146 This command sets up an event to be triggered when the value of the Event Source is between the Set Up lower and upper threshold This command should be Enter followed by the Define Setting Command which is Normal where you define your lower and upper thresholds Event Event Sources can come from sensor values from ports 1 2 3 container values mail values and timer values If using a sensor value the sensor Should be zeroed prior to setting up the event Example val eo P m This piece of code defines the thresholds for the Enter Low Event icon It then sets up the red Enter Low Event and begins monitoring The program will play a sound over and over again until the value of the mailbox goes above 10 or below 5 This event will force the program to the place where the Event Landing icon is located Make sure you define a lower upper or normal threshold event before you set them up education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 147 This command sets up an event to be triggered when the value of the Event Source 1s above the Set Up upper threshold This command should be followed Enter Hi OY the Define Sett
232. s Depending on the desired sensitivity and direction the motor is connected the values in the speed expression may need to be modified education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 28 Behaviors This behavior is Go Straight This behavior is written for a two motor car In any behavior Go you can modify the code to fit your needs Straight Example This code turns motors A and C on in the forward direction for 1 second then turns off the motors This behavior is Turn This behavior 1s written for a two motor car In any behavior you can Turn modify the code to fit your needs Example This code turns motor A on forward and motor C on backward After 0 25 seconds the motors are turned off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 29 This behavior is Lurch It makes the car go A forward then stop then go forward again a Lurch number of times This behavior is written for a two motor car In any behavior you can modify the code to fit your needs Example casi
233. s command to fill a container with the value of the light sensor The default is to Light set the Red Container to the value of the light Container sensor on port 1 In your program be sure to specify what port your light sensor is connected to with a modifier Example This piece of code fills the Yellow Container with the value of the light sensor A sound is played and the value of the Yellow Container is shown on the RCX If the value of the light sensor was 41 the RCX would read 41 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 219 Use this command to fill a container with the value of the temperature Celsius sensor The default is to set the Red Container to the value a of the temperature sensor on port 1 In your program be sure to specify what port your temperature sensor 1S connected to with a modifier Rounds value to nearest integer value 20 7 goes to 21 Example This piece of code fills the Red Container with the value of the Temperature sensor in Celsius A sound is played and the value of the Red Container is shown on the RCX If the value of the sensor was 25 deg the RCX would read 25 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO
234. s equal to an amount of time or not 01 Equal Fork Example This piece of code part of a larger program will add 1 to the container while the timer reading in hundredths of seconds is not equal to 600 The value of the container is Shown on the display education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 102 ellow Jump Jumping 1s useful when certain commands are to be repeated Each Land command needs to be used in conjunction with its same colored Jump command Example This piece of code will play the fast rising sweep sound until the touch sensor is pressed The pressing of the touch sensor is set up as a red event education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineer ing com ump ing 103 Green Land Land Land Jumping 1s useful when certain commands are to be repeated Place the Land command where you want to Start after a jump Each Land command needs to be used in conjunction with its same colored Jump command Example This piece of code will play the f
235. s of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 305 ia Control Lab Interface Output A Output B Output C Output D Output E Output F Q Output G Output H These are output modifiers for the Control Lab Interface String them onto motors Lamps etc that are connected to the Control Lab board Example This piece of code would turn on motors connected to all 8 outputs for 2 seconds and then turn them off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 306 4 4 Input 1 Input 2 Input 3 Input 4 These are input modifiers for the Control Lab Interface String them onto sensors etc that are connected to the Control Lab board Example This piece of code would wait until the reading on the light sensor attached to port 4 increased by 5 Then it would display the value of port 4 on the control panel amp Input 5 Input 6 Input 7 Input 8 These are input modifiers for the Control Lab Interface String them onto sensors etc that are connected to the Control Lab board Example This piece
236. s on motor A in the forward direction then starts a loop which continuously flips the direction of the motor and waits 1 second until the temperature gets to or goes below 30 degrees Celsius When this happens motor A is shut off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 114 Loop While Mail is Loop While Mail is Less Than Greater Than Use these to start a Loop while the value of the mail 1S below or above a certain number The Loop will end when the value of the mail becomes that number or higher Less Than icon or when the mail becomes that number or Lower Greater Than icon With respect to the Less Than icon if the value of the mail is higher than that number when the program reaches this command it will skip the loop When using the Greater Than icon if the value of the mail is less than that number when the program reaches this command it will Skip the Loop An End of Loop icon is needed somewhere after each icon Example This piece of code fills the mailbox with the value of 5 then starts a Loop which turns on Lamp A The loop ends when the RCX receives mail whose value is 4 or less Then the RCX plays a sound and turns off the Lamp education LEGO the LEGO logo and MINDSTORMS are trademarks
237. s reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com Y Value Red Event 288 Y gt Q of Value of Value of Value of Blue Yellow Generic Event Event Event Use these modifiers to represent the value of the Red Blue Yellow or Generic Event Example This piece of code sets up a red event that is triggered when the touch sensor is pressed The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the touch sensor is pushed in This will force the program out of the jump sequence and make it land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 289 Value of Value of Value of Red Blue Generic Upper Upper Upper Threshold Threshold Threshold Threshold Use this modifier to represent the value of the upper threshold of the Red Blue Yellow or Generic Event Example This piece of code sets the red event to be a normal event with an upper threshold of 60 a Lower threshold of 40 duration of 10 seconds and hysteresis of 2 The program will beep repeatedly until the sensor on channel 1 fulfills the event requirements It will then display the value of the red upper
238. s to 1 minute the default motor A turns off Clears data logging memory Helpful if you re taking lots of data or have a lengthy program Clear Data Logging Memory Example This piece of code clears the data memory then logs 500 points of rotation sensor data education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 204 PA Use this to reset the NXT touch sensor Helpful ae 1f taking touch sensor data NXT Zero Touch Sensor Example This piece of code resets the NXT touch sensor on port 2 and then initiates touch sensor logging on the NXT touch sensor on port 2 It begins data collection logging light sensor data every 1 minute to the Blue Data Set until for 30 minutes education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 205 T Use this to reset the NXT click count sensor E Helpful if taking clicks data NXT Zero Clicks Sensor Example This piece of code zeros the NXT clicks sensor It then initiates click sensor logging on port 1 It begins data collection logging clicks sensor da
239. sing values associated with the Red Timer Example This piece of code zeroes the Red Timer and then waits for 10 seconds The value of the Red Timer is put into the Red Container and then displayed on the RCX education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 273 Red Data Set Blue Data Set Yellow Data Set Use this modifier to indicate that you are using values associated with the Red Blue or Yellow Data Set You can wire in additional Data Sets Example This piece of code will initialize the light sensor on port one and will begin data logging on the Red Data Set for 10 points This code captures data every second education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 274 Q o 99 Sample one Sample one Sample ten Sample one Sample one tenth sec sec sec minute hour Use this modifier in a data acquisition program to take a Sample for a specified amount of time Example This piece of code will initialize the light sensor on port one and will begin data logging on the Red D
240. sit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 313 Use this modifier to indicate you are using the amp gt encoder in Motor B This can only be used with ki the NXT motors Encoder B Example This program turns on motor B and then waits for the NXT encoder in the motor on port B to reach 720 2 rotations at 360 for each rotation Then the motor is turned off Use this modifier to indicate you are using the encoder in Motor C This can only be used with the NXT motors Encoder C Example This program turns on motors A and C and then waits for the NXT encoder in the motor on port C to reach 720 2 rotations at 360 for each rotation Then the motors are turned off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 314 Use this modifier to get the value of the angle lt gt sensor built into the NXT motor connected to port pa A It works in the same way as the value of Port 1 2 3 and 4 modifiers Value of Encoder A Example This program is run in direct mode so the NXT needs to be connected to the computer This code will turn on motors A and C until the touch sensor on port 1 is pressed Then the value of the rotation sensor built into motor A will be placed in a con
241. sor is pushed in and released This will force the program out of the jump sequence and make it land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 138 This command sets up an event to occur when the value of the light sensor goes above the threshold The threshold can be modified with an Light event modifier The default is a red event that waits for a light reading higher than 55 from SAL port one This command must appear before the Begin Monitoring command in your program You can string in a yellow blue red or generic modifier to have several events You can also string in an event source source of information such as sensor values of ports 1 2 amp 3 container values or mail values Example This piece of code sets up a blue event that is triggered when the light value goes above the threshold The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the light value goes above the threshold This will force the program out of the jump sequence and make it land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group
242. st for inspiration go to www ceeo tufts edu ROBOLAB software is powered by the National Instruments LabVIEW programming environment National Instruments created LabVIEW for industry engineering applications The general National Instruments website is found at www natinst com If you would like to learn more about LabVIEW programming National Instruments has online and Instructor Led courses available For details see www ni com custed Robotics Ideas For inspiration on building different kinds of LEGO robots see the LEGO MINDSTORMS website www lego com robotics For robotics enthusiasts and information on programming in other environments try the online community www lLugnet com To get to the ROBOLAB area on this site go to www lugnet com robotics rcx robolab Note This group is not affiliated with the LEGO Group education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 387 Appendix a education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 388 Troubleshooting Programming Problems My motors
243. stead of downloading them to an interface education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 371 2 RCX this mode configures all communication and settings for the RCX 3 Scout this mode configures all communication and settings for the Scout 4 Control Lab this mode configures all communication and settings for the Control Lab Interface If the user sets this tag to be 4 Control Lab mode for example then all of the Pilots Investigator pages and Inventor programs will work directly with the Control Lab Interface instead of the RCX Camera Specifies which camera is being used by ROBOLAB This can be selected from within ROBOLAB by choosing the Select Camera option from the project menu Note If there are any problems with any of these commands Simply delete the line and ROBOLAB will replace the line with the default factory setting education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 372 4 2 Creating your own Sensor Definition Files Sensor definition files allow ROBOLAB to be correctly
244. such as sensor values of ports 1 2 and 3 container values or mail values Example This piece of code sets up a blue event that is triggered when the value of the light sensor goes below 10 the light threshold The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the value of the light sensor goes below 10 This will force the program out of the jump sequence and make it land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com Log This command sets up an event to occur when the value of the NXT sound sensor goes above the threshold The threshold can be modified with an event modifier The default is a red event that waits for a sound reading higher than 55 from NXT Set port one This command must appear before the Up Begin Monitoring command in your program You can hig a string in a yellow blue red or generic N volume modifier to have several events You can also Event String in an event source source of Information such as sensor values of ports 1 2 and 3 container values or mail values This piece of code sets up a red event that is triggered when the value of the volume sensor goes
245. t Up threshold in Celsius The threshold can be inerease modified with an event modifier The default is in Temp a red event that waits for a temperature C Event reading above 30 C from port one This command must appear before the Begin Monitoring command in your program You can string ina yellow blue red or generic modifier to have several events You can also string in an event source source of information such as sensor values of ports 1 2 amp 3 container values or mail values Example This piece of code sets up a blue event that is triggered when the temperature value goes above the threshold in Celsius The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the temperature value goes above the threshold This will force the program out of the jump sequence and make it Land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 141 This command sets up an event to occur when the value of the temperature sensor goes above the Set Up threshold in Fahrenheit The threshold can be inerease modified with an event modifier The default 1S a in Temp red event that waits for a temperature reading F Ev
246. ta every 0 1 seconds Motor A turn on and continues for 8 seconds Then data collection and Motor A stop education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 206 Fy Use this to reset the NXT touch and release oon sensor Helpful if taking clicks data NXT Zero Touch And Release Sensor Example This piece of code zeros the NXT touch and release sensor Then it logs touch and release sensor data every second for 45 seconds and stops education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 207 Sn Use this to reset the NXT light sensor Helpful if taking light data NXT Zero Light Sensor This piece of code resets the light sensor and initiates light sensor logging on the NXT sound sensor on port 1 It begins data collection logging light sensor data every 1 second to the Red Data Set until it collects 50 data points Example education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL othe
247. ta points Stop Logging Example This piece of code resets the light sensor and then logs 10 light data points Use this command to start data logging again after it has been stopped Resume Logging Example This piece of code would log data from the rotation sensor until the touch sensor was pushed in Then it would stop until the touch sensor was released Then it would resume data logging for 2 seconds education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 191 Use this command to find out how much time has passed since you began taking data Log Time Stamp Example This piece of code would log data from the rotation sensor until the touch sensor on port 2 is pressed Then it would log how much time has passed since data logging began and Stop logging data Use this command to take voltage data from a generic powered sensor Initialize Generic Sensor Logging Example This piece of code would take 10 data points from a generic powered sensor education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducat
248. tainer and the motors will be stopped LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 315 Use this modifier to get the value of the angle lt gt sensor built into the NXT motor connected to port ti B It works in the same way as the value of Port 1 2 3 and 4 modifiers Value of Encoder B Example This code will turn on motors A and C until the touch sensor on port 1 is pressed Then the value of the rotation sensor built into motor B will be placed in a container and the motors will be stopped Use this modifier to get the value of the angle i sensor built into the NXT motor connected to port lt gt B It works in the same way as the value of Port 5 1 2 3 and 4 modifiers Value of Encoder C Example This code will turn on motors A and C until the touch sensor on port 1 is pressed Then the value of the rotation sensor built into motor B will be placed in a container and LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineering com 316 the motors will be stopped This command clears the NXT display This is usefu
249. tainer should be filled with the value of 4 Zero 0 corresponds to the Red Container so the Red Container is filled with a value of 4 and that is then displayed on the RCX The program then waits 4 seconds and then shows the value of the Generic Container that is still education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation com amp ww LEGOengineering com 269 i Use this icon to name a generic container Use the pointer tool to choose a container name from the drop down menu For example container 3 can be used by selecting amp quot User3 amp quot Container Example This piece of fills container 3 with a value of 5 It then displays the value of the container 3 which was just set to 5 The display will then show amp quot 5 amp quot for eight seconds education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 270 This modifier allows you to access the container where a variable is stored Type the variable name in the string constant Variable Modifier Example This code zeros the NXT rotation sensor on Motor A then turns
250. tainer with the value of the pressure sensor adapter The Prascure default is to set the Red Container to the Comrainer value of the pressure sensor adapter on port Pressure 1 In your program be sure to specity what LogIT port your pressure sensor adapter is connected to with a modifier Example This piece of code fills the Red Container with the value of the pressure sensor A sound is played and the value of the Red Container is shown on the RCX If the value of the pressure sensor was 4 the RCX would read 4 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 246 pe Use this command to fill a container with the Hos value of the sound level sensor The default Sound Level is to set the Red Container to the value of CO Aaner the sound level sensor on port 1 In your Sound program be sure to specify what port your LogIT sound level sensor is connected to with a modifier Example This piece of code fills the Red Container with the value of the sound sensor A sound is played and the value of the Red Container is shown on the RCX If the value of the sound sensor was 8 the RCX would read 8 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group Th
251. tensity graph education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 353 Pe Use this to save your image as a bitmap bmp bmp file Save BMP Example This piece of code initializes a small image allows the user to adjust camera options takes a color image and saves it as a bmp file Lae Use this icon to select a subset of an image you wry have grabbed Get Image Subset Example This piece of code saves a subset of the image to a bmp file education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 354 Use this icon to select a region of interest in an image you have grabbed This piece of code grabs a grayscale image from the camera allows the user to select a region of interest ROI extracts that subset from the image and displays the histogram of that subset on the front panel i Use this like a Begin icon This does NOT grab co sound it only initializes the microphone Init Mic Example This piece of code initializes the microphone grabs a sound and saves it as a wav file
252. ter ten seconds it checks to see if it has received mail whose value is greater than 1 the default If it has the RCX plays a sound Use this fork if you want to take different courses of action based on a rotation sensor A Tr fork merge is required at some point after this Sensor icon Also a zero angle sensor command should Fork be used sometime before this icon Reminder rotation sensor reads in sixteenths so a reading of 16 equals one rotation Rotation can be either forward or backward Example This program zeros the angle sensor then waits 10 seconds If at that point the rotation sensor reads greater than 1 rotation a reading of 16 then the RCX plays a sound LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 83 Use this fork if you want to take different courses of action based on the number of clicks on a touch sensor A fork merge is required at some point after this icon Also a zero clicks sensor command should be used sometime before this icon Example This piece of code turns on motor A for 10 seconds then shuts it off If after 10 seconds the touch sensor has been clicked more than 10 times it plays a sound Use this fork if you want to take different courses of action based on
253. that number Less Than icon or below Greater Than icon when the program reaches this command it will Skip the loop An End of Loop icon is needed somewhere after each icon Example This piece of code would zero the container Then it would Start a loop that plays the note C and adds one to the container The program plays the note C five times education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 111 re ra a ae Loop While Loop While Rotation Sensor is Rotation Sensor is Less Than Greater Than Use these to start a Loop while the rotation sensor reads below or above a certain value The loop will end when the angle sensor gets to or goes beyond Less Than icon or to or below Greater Than icon that value It is helpful to use a zero angle sensor icon before this command An End of Loop icon is needed somewhere after each icon Example This piece of code zeros the angle sensor then starts a loop that continuously plays the note C anda rest until the rotation sensor reads a value of 16 one rotation the default education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use
254. the container The loop would end when the container reaches 5 In total it will play the note C five times education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 202 Use to reset timer Helpful whenever you use the timers Timer Example This piece of code turns on lamp A for a random amount of time and then turns it off If the time is less than 3 seconds the timer measures tenths of seconds so the modifier 30 1s equivalent to 3 seconds the RCX plays a sound Use this to empty the mailbox Helpful when you a are planning to receive new mail or want to check Tere for new mail Mailbox Example This piece of code would empty the mail box After 10 seconds it checks to see if it has received mail whose value is greater than 1 the default If it has the RCX plays a sound education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 203 Use this to reset the RCX clock Zero Clock Example This piece of code resets the clock to zero and turns on motor A When the clock get
255. the power spectrum of it and plots the result in the green bin education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineering com 341 Use this command to upload data directly from the RCX Useful if you often work in levels 4 amp 5 of Upload G Code or if you are using data logging functions Data Load Data in Inventor Example This piece of code uploads data from the RCX takes the second data set finds the histogram and plots the result in the green bin Use this command to load data into Investigator from an external file When a program is run containing this command you will be prompted to find the location of the file you wish to load This can be useful if you want to transfer data from one Investigator project to another export the data from one project and load it into another Example This piece of code prompts the user to specify a file to load fits a curve to it and plots the result in the Brown Bin education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 342 Use this command to save
256. the number of touches and releases on a touch sensor A fork merge is required at some point after this icon Also a Release zero touch and release sensor command should be Fork j used sometime before this icon Example This piece of code turns on motor A for 10 seconds and then shuts it off If after 10 seconds the touch sensor has been touched and releases more than 10 times it plays a sound education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 84 Use with Investigator commands Use this fork if you want to take different courses of action based on the number of points gathered A fork merge 1s required at some point after this icon This piece of code logs light sensor data points for a random time If after that time there are 5 the default or fewer data points it logs data for 2 more seconds before stopping If after the random time there are greater than 5 data points it stops logging points Use this fork if you want to take different courses of action based on the value of the RCX clock A fork merge is required at some point after this icon Example This piece of code would check the value of the RCX clock If the clock read 1 minute the default or less then motor A would turn on
257. the rate is computed by dividing the rotations by 4 the number of seconds the motor ran Next the rate is place in the red container Finally this value is displayed on the RCX education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 226 This VI allows you to name a variable and set it equal to a numeric constant or the value of any modifier Fill String Container Example 7 A a a w m J E 5 M ra at n 2 femal A 4 fen F Sa Is alte rate rate rotations 4 This code zeros the rotation sensor on port 1 then it runs motor A forward for 4 seconds and turns off the motor The value of the rotation sensor on port 1 in a container that is named rotations Then the rate is computed by dividing the rotations by 4 the number of seconds the motor ran Next the rate is place in the red container Finally this value is displayed on the RCX education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 221 Use this command to fill a container with the value of the NXT light sensor T
258. the touch sensor is pressed it will play a sound Use this to start a loop while the number of touches and releases is less than a certain Loop While value It may be helpful to zero the touch and release sensor before this command An End of Loop icon 1s needed somewhere after this icon Number of Touches and Releases is Less Than Example This piece of code would start a loop that would continuously play the note C and a rest until the number of touches and releases was 10 the default education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 108 Use these to start a loop while the number of clicks is less than a certain value It may be helpful to zero the clicks sensor before the While command An End of Loop icon 1s needed somewhere Number after this icon of Clicks 1s Less Than Example This piece of code zeros the clicks sensor and then starts a loop that would continuously play the note C anda rest until the number of clicks was 10 the default education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQ
259. tion or LabVIEW for Everyone or a host of other books on programming in LabVIEW See www ni com for more Information education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 384 5 Help amp Idea Sources The ROBOLAB developers and the general ROBOLAB community are constantly coming up with new ways of Learning how to use the software as well as cool new ideas for classroom home or after school projects The best way to find the Latest news downloads and links is to visit http www Lego com eng education mindstorms under Support or http www ceeo tufts edu robolabatceeo Included with Your Installation of ROBOLAB e Setup describes the steps for preparing the hardware the LEGO RCX programmable brick and IR Transmitter used for communication between the computer and the RCX e Training Missions provide step by step instructions so that you and your students get started with Pilot and Inventor styles of programming e ROBOLAB Help is available as you are running ROBOLAB Help is activated by clicking Help in the menu or pressing CTRL H on your Keyboard Help provides Information about the object or icon on which your mouse 1s placed Software Guide Using ROBOLAB For a more detailed introduction to using the s
260. toring data has changed To see where your user data is stored check the paths for your version REMINDER Always Back UP DATA before upgrading or Installing new versions of ROBOLAB ROBOLAB 1 0 2 0 User Data is stored directly in the ROBOLAB folder in the Program Vault Investigator Themes and HIML folders All user data 1S saved to these folders unless otherwise specified ROBOLAB 2 5 0 2 5 2 The User Data is stored within the ROBOLAB folder in a folder entitled My Data which contains the folders Program Vault Investigator Themes HTML Vision Songs All user data is saved to these folders unless otherwise specified ROBOLAB 2 5 3 and higher ROBOLAB 2 5 3 was designed to accommodate multiple users and security settings User data is stored in a folder entitled ROBOLAB Data The folder is placed into the location designated by the system for user data to be saved on the PC this is most often My Documents and on the MAC it is typically in the user s documents folder If the logon to a computer has been customized to use a network location for saving user data ROBOLAB will use that location for the ROBOLAB Data folder education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 366 4 Customizing ROBOLAB ROBOLAB
261. trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 23 Reverse Forward This command just sets the direction of the motor to forward or reverse It does NOT turn the motor on It needs to be used in combination with a command that Starts the motor or at a point in your program where the motor is already on If the motor is already going in the reverse or forward direction there will be no change Example This piece of code assigns the speed of motor B to 3 and the direction of motor B to reverse and then turns it on After 2 seconds it turns the motor off education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 24 Use this icon when you want the direction of the motor to be randomly selected This does NOT turn the motor on It needs to be used in Direction combination with a command that starts the motor or at a point in your program where the motor is already on Example This piece of code turns motor A on in the forward direction and then randomly selects a direction for the motor forward or backward the motor runs for 10 seconds an
262. ult Barometric 1s to set the Red Container to the value of the barometric sensor on port 1 In your Sensor Container program be sure to specify what port your barometric sensor is connected to with a modifier Example This piece of code fills the Red Container with the value of the barometer sensor A sound is played and the value of the Red Container 1s shown on the RCX If the value of the barometer sensor was 8 the RCX would read 8 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 253 Use this command to fill a container with the value of the Redox sensor The default is to set Para the Red Container to the value of the Redox T sensor on port 1 In your program be Sure to Container specify what port your Redox sensor is connected to with a modifier Example This piece of code fills the Red Container with the value of the Redox sensor A sound is played and the value of the Red Container is shown on the RCX If the value of the Redox sensor was 8 the RCX would read 8 education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeduc
263. und LogIT BH LogIT Pressure LogIT Position LogIT Analog LogIT Voltage LogIT Accelerometer mists LogIT Accelergmeter fg LoglT Barometric LaglT redox LogIT Current LaglT Select your sensor adapter from the list For information on how to include your custom sensor adapter in Inventor programs please visit www Lego com eng education mindstorms or www ceeo tufts edu robolabatceeo LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 378 4 3 Customizing Investigator There are two levels of creating custom features in the Investigator component The first and easier method does not require any LabVIEW programming skills The second method requires working knowledge of LabVIEW The Simple Way If you simply want to have some customized output from a compute page you can start using the front panel ona compute level 4 or 5 palette Every vi or virtual Instrument has two parts a panel and a diagram Inventor level coding is all based only on the diagram and you never use the panel Pilot levels are all just panels with some rather complicated Inventor style diagrams If you start up a compute 4 page by clicking on and move the diagram down by moving the title bar You should have something Sot Application F
264. ur computer right click control click for Mac users on the lower NXT Draw left corner and choose create constant If you Bitmap leave the path blank you will be able to browse for the file Example LOesktool smile brig This program clears the NXT display and then loads the bitmap file smile bmp onto the display This will display for 2 seconds before the program ends education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com nv NXT 324 This command allows you to write formatted text to the NXT display and display multiple variables Formatted text allows you to display values of containers To display an integer use d to display a floating point number use Expanded f with then the number of decimals to Formatted display between the and the f For example Text 0 1f would display one number behind the decimal point To create the string to write on the NXT display right click control click for Mac users on the Lower right corner and choose create constant To choose the row to display the text right click on the lower left corner and choose create constant Row is at the top of the screen and row 7 is at the bottom Example MS el WSS LE SSS This program takes the value
265. use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com Peak Time 331 Peak time 1S the time between two wells wells are defined as values below a threshold or cutoff value Use this command to determine the amount of time between peaks above the cutoff value of a data set If you have multiple peaks on your graph this command will return a graph of the well times between each one Useful for measuring for time between touch sensor presses or Light sensor spikes Example This piece of code creates a graph of all the peak times above the cutoff value for the red data set and plots it in the purple bin education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 332 3 Ihe threshold command allows you to extract data from a data set based on bounds within the data Threshold set or bound of a second data set Example 70 00 This piece of code extracts the values from the data set in the purple bin if the data in the orange bin is between 7 0 and 101 and plots the result to the green bin PA Use this command to fit a line to your data If a you need other information about your line rit Lane Offsets and Slopes these can be displayed on the front panel Example
266. used to start and end direct communication between the RCX and the tower Begin Commands that appear between the two icons are sent to the RCX in direct mode there must be End i direct continuous line of site between the RCX and the mode tower Example This piece of code would turn motor A on for 2 seconds and then turn motor A off If you are running a direct mode program it can be useful to know if the RCX is in view of the tower and can receive commands This command updates a Boolean true false indicator with a true if the tower can talk to the RCX and a false if the tower cannot talk to the RCX Example This piece of code looks to see if the RCX is in view of the tower It updates the Boolean indicator Exists with the current status education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGOengineering com 296 The memory map icon gives you a reading of the memory contents of the RCX It MUST be used in direct mode and outputted to the front panel This piece of code will read the RCX memory contents and display the readings on an indicator on the front panel Use this icon to determine whether your RCX is et Still running a program i e is the person Read Run running Should be used in direct mode
267. ustom sensor used here 1s called Brick Size was created in vision center and performs a blob area operation on a masked portion of the Image where a Lego brick is Known to be The image is also converted to a ROBOLAB picture before and after the vision sensor to clarify what 1s going on On the front panel of this program we therefore have a picture of the grabbed image the processed image and the sensor result in this case the area of the blob located within the mask Here a 2x8 brick is placed in front of the camera and the resulting area is shown in pixels education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 361 Grabbed Image _ Processed Image Result If we place a smaller brick 2x4 in front of the camera we get the corresponding images and result for the area which we would expect to be approximately half that of the 2x8 brick Result _Grabbed Image Processed Image e education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 362 Example 2 This program shows how to download
268. w MINDSTORMSeducation com amp ww LEGOengineering com 194 Use this command to take temperature data in Celsius from the temperature sensor adapter alize LogIT You cannot take data in Fahrenheit proTemp with this sensor Sensor Logging Example This piece of code would take 10 data points from the temperature sensor Use this command to take position data in degrees from the position sensor adapter Initialize Logit Position Sensor Logging Example This piece of code would take 10 data points from the position sensor LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 195 Use this command to take voltage data from the voltmeter LogIT Initialize Voltmeter Sensor Logging Example This piece of code would take 10 data points from the voltmeter Use this command to take voltage data from the acceleration sensor Initialize Acceleration Sensor Logging Example This piece of code would take 10 data points from the acceleration sensor education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation
269. y be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com NXT S Up Cl Event number of NXT clicks equals 155 This command sets up an event to occur when the the clicks threshold The default is a red event that waits for 10 clicks on port one This command must appear et before the Begin Monitoring command in your 1CKS program You can string in a yellow blue red Or generic modifier to have can also string in an event information such as sensor and 3 container values or several events You source source of values of ports 1 2 mail values This piece of code sets up a blue event that is triggered when the number of clicks equals the clicks threshold The Monitor Event icon begins monitoring for such an event to occur A sound will be played over and over again until the number of clicks equals the clicks threshold This will force the program out of the jump sequence and make it land where the Event Landing is located education LEGO the LEGO logo and MINDSTORMS are trademarks of the LEGO Group 2006 The LEGO Group This page may be photocopied for non commercial educational use ALL other rights reserved Visit ww MINDSTORMSeducation can amp ww LEGQengineer ing com 156 This command sets up an event to occur when the number of NXT touch and releases equals the touch and release TR threshold

Download Pdf Manuals

image

Related Search

Related Contents

Olympus VN-120PC User's Manual  Roadstar CDR-4550U  Zeitrelais und Zykluszähler CUB5T  QIG 4ipnet HSG327  Fibermesh  Teléfono Inalámbrico de 2,4 GHz de Espectro de  dossier d`inscription animateur  パルス入出力モジュール  Betriebsanleitung CB-007-1  

Copyright © All rights reserved.
Failed to retrieve file