Upcoming SlideShare
×

Like this presentation? Why not share!

# Variable Op

## on Jun 15, 2008

• 554 views

### Views

Total Views
554
Views on SlideShare
429
Embed Views
125

Likes
0
0
0

### 4 Embeds125

 http://roboticacmb.blogspot.com 52 http://roboticacmb.blogspot.com.ar 44 http://www.roboticacmb.blogspot.com.ar 26 http://www.roboticacmb.blogspot.com 3

### Report content

• Comment goes here.
Are you sure you want to

## Variable OpPresentation Transcript

• Value Control with Variables Joe Long Robofest Student Assistant Lawrence Tech Computer Science Major [email_address] April 12, 2007
• Create the variable
• Navigate to the ‘Edit’ menu (next to ‘file’)
• Click on ‘Define Variables’
• Click ‘create’ and enter
• the variable information
• and type.
• Click ‘Close’
• Getting the light value
• Open the ‘complete’ block menu ( )
• Find a Light Sensor block and drag it onto the field.
• Saving the value to a variable
• Find a Variable block and drag it onto the field.
• In the block’s options panel, change it’s Action to ‘Write’ and select your created variable from the List.
• Make the Data Wires (light value saved to a variable)
• Click on the ‘tab’ sticking out of the light block ( ), then click on the back ‘tab’ sticking out of the ‘write’ mode variable block
• The wire should look
• like this:
• Drag another variable block onto the field.
• In the options panel, select your variable from the list and set the mode to ‘read’.
• The block should look like this
• When you are done:
• Add 2 to the variable
• Find the ‘Math’ block and drag it onto the field.
• Draw a data wire from the second variable block to the ‘A’ tab on the math block:
• Using the math block
• Open the math block’s options panel.
• Set the Operation to ‘Addition’
• You can see that the space for ‘A’ is grayed out, as it is already used.
• In the ‘B’ space, type in ‘2’
• Convert the answer (number) to text for displaying
• Find the Number to Text block
• Draw a data wire from the ‘#’ tab of the math block to the ‘#’ tab of the conversion block.
• Displaying the value
• Find the Display block and put it on the field:
• In the display block’s options panel, set the Action to ‘Text’ (the location can also be experimented with)
• The block should now look like this:
• Displaying the value
• Open the display block’s drop down menu (by clicking on the line at the bottom edge of the block)
• Connect a data cable from the
• output of the converter to the
• ‘ T’ tab of the display block.
• Display the data for 5 seconds
• Find a Wait block and drag it onto the field:
• In the options panel, set the Control to ‘Time’ and input 5.
• Complete
• Steps: