Recent Changes - Search:

TEAMS Academy Wiki


Explore TEAMS!
for visiting sophomores & juniors


Robotics

EnvBioTech

Bat Design

Assistive Tech

Students

Instructors

TEAMS Forum

TEAMS Calendar

TEAMS Web Site

Wiki Info

edit Explore.SideBar

The Procedure Buttons and What They Do

Back to main page

Here's a description of some of the (+more useful+) Procedure buttons

diamond shape Select this to begin your procedure. When you drag the diamond out to the blocks field, a new block labeled "proc1" on the left hand side.("proc2", etc will appear with more procedures)

call block The call block will have the same name on it as the procedure you create. Insert the call block into your program whenever you want to call the procedure.





  • Here is what the procedures window will look like when you first bring out a new procedure.
  • Double click on the procedure diamond to give it a name.



Here is an example of a procedure in code, and the procedure in a program

This short program calls a procedure named StopGo...

  • The program first makes the Cricket beep three times.
  • Then it checks to see if the switch in port b is depressed.
  • If it is, the StopGo procedure is called. The program will "jump" over to the StopGo group of logo blocks and execute those commands...see below!


When this procedure is called, each of the block of code will be executed in order, then the procedure will end and return the to program that called it. Here's what this procedure does...

  • Stop both motors
  • Checks switch A
  • If switch A is depressed then...
    • turns motor A on for one second
    • turn on both motors on for one second
    • then turn on motor B on for one second
  • When the last block is executed, the program jumps back to the main program and continues to the next step in the main program
  • Note that procedures can call other procedures!
Edit - History - Print - Recent Changes - Search
Page last modified on May 06, 2008, at 02:21 PM