Showing posts with label Pro-Bots. Show all posts
Showing posts with label Pro-Bots. Show all posts

Monday, September 28, 2015

Draw Polygons & Compound Figures with a Given Area using Pro-Bot

Can you program the Pro-Bot to draw polygons & compound figures with a given area?

This, again, is an assignment that I designed for our Grade 3 students. It relates to the Common Core Math Standards: Geometric measurement: understand the concepts of areaFor this exercise, I highly recommend using graph paper, as it provides a helpful medium for the kids to work out the math problems. Provide at least one sheet per child to work out the problem and then additional sheets as required for the groups to draw the figures using Pro-Bot. Here is a link to a graph paper with 1 cm grid in PDF format; you can make copies for the students to draw on using the Pro-Bot.


Area of a Figure


The area of a figure is the number of squares required to cover it completely, and is specified in square units. Here's an article from math.com that gives a quick overview of the topic.

How do you calculate the area of a given figure? You add the number of squares needed to cover the entire figure. Say you are given a square with sides 3 cm each. You need 9 squares of sides 1 cm x 1 cm to cover it completely. The area of the square is 3 x 3 = 9 sq.cm. Similarly, a 5 cm x 6 cm rectangle has an area of 30 sq.cm.

Can we do the reverse too? Given the area, can we come up with the design for a figure with that area? 

Let's look at an example. Given an area of 9 sq.cm, how many polygons can we draw? We can draw multiple polygons, all with the exact same area of 9 sq.cm. In the figure below, you can see:
  • a square 3 cm x 3 cm,
  • couple of polygons with an area of 9 sq.cm.

Can you think of more polygons with an area of 9 sq.cm?

Let's now look at a scenario that shows the practical application of the concept of area. And then program the Pro-Bot to draw a few polygons with a given area.

Programming Assignment

You work for an architectural firm, and have been asked to design a single story house with a floor area of 100 square meters (roughly 1076 sq.ft.) You are to draw and present various designs for the floor plan.

  1. How many different ways can you draw the floor plan with an area of 100 sq.m.? Provide at least 2 to 3 different designs and make a rough drawing of the figures that you come up with.
  1. Classify the figures that you came up with into the various classes of polygons based on the number of sides.
  1. Program the Pro-Bot to draw them on graph paper. Use 1 sq.cm. to represent 1 sq.m. in your figures.
  1. Assume that the plot of land available for the construction, is a rectangle that is 15 m long and 8 m wide. Can you provide a design(s) to build a 100 sq.m. building in this plot? Program your Pro-Bot to draw the design. 
  2. You can program the Pro-Bot to draw other figures with the 100 sq.m. area. Or explore other figures with different areas.

Draw Polygons with a Given Perimeter using Pro-Bot

Can you program the Pro-Bot to draw polygons & compound figures with a given perimeter?

This is an assignment that I designed for our Grade 3 students. It relates to the Common Core Math Standards: Geometric measurement: recognize perimeterFor this exercise, I highly recommend using graph paper, as it provides a helpful medium for the kids to work out the math problems. Provide at least one sheet per child to work out the problem and then additional sheets as required for the groups to draw the figures using Pro-Bot. Here is a link to a graph paper with 1 cm grid in PDF format; you can make copies for the students to draw on using the Pro-Bot.


Perimeter of a Figure


A perimeter is a path that surrounds a two-dimensional shape. The term may be used for either the path or its length. It can be thought of as the length of the outline of a shape. (Wiki)

How do you calculate the perimeter of a given figure? You add the length of all the sides of that figure that form its outline. Say you are given a square with sides 3 cm each. The perimeter of the square is 3 + 3 + 3 + 3 = 12 cm. Similarly, a 5 cm x 6 cm rectangle. has a perimeter of 5 + 6 + 5 + 6 = 22 cm. 

Can we do the reverse too? Given the perimeter, can we come up with the design for a figure with that perimeter? 

Let's look at an example. Given a perimeter of 12 cm, how many polygons can we draw? We can draw multiple polygons, all with the exact same perimeter of 12 cm. In the figure below, you can see:
  • a square 3 cm x 3 cm,
  • a rectangle 5 cm x 1 cm,
  • a rectangle 4 cm x 2 cm,
  • a hexagon with sides 3 cm, 1 cm, 1 cm, 1 cm, 4 cm, 2 cm

Can you think of more polygons with a perimeter of 12 cm?

Let's now look at a scenario that shows the practical application of the concept of perimeters. And then program the Pro-Bot to draw a few polygons with a given perimeter.

Programming Assignment

Old McDonald lives on a farm and has lots of animals. He would like to build a new set of fences to keep his cows safe.

  1. If Old McDonald has 36 meters of fencing available, how many different ways can he build an enclosed area for his cows? Make a rough drawing of the figures that you come up with and then program the Pro-Bot to draw them on graph paper. Use 1 cm to represent 1 m in your figures.
  2. Classify the figures that you came up with into the various classes of polygons based on the number of sides.
  3. Write programs for Pro-Bot to draw at least 3 of the figures that you came up with.
  4. Suppose Old McDonald has only 35 meters of fencing available, but wants to build a square or rectangular fence using all of that fencing material. Would it be possible for him to build it? Why or why not? 
  5. You can program the Pro-Bot to draw other figures with the 36 cm perimeter. Or explore other figures with different perimeters.


Tuesday, April 21, 2015

A Drive through the Zoo: Learning about Angles using Pro-Bot

My child's class started learning about angles about a week ago. And the teacher requested me to design an exercise for Pro-Bot that will introduce the idea of angles. As the kids are very new to the concept, I wanted to keep this one fairly simple, while still using a mix of acute, obtuse and right angles.

A trip to the zoo is almost always part of our field trips every school year. The zoo in our city happens to have buses that drive along the various points of interest/ themed animal enclosures. I felt that the turns made by the bus in this familiar setting of the zoo, might be a good way to introduce angles.

In this exercise, a scaled down version of the bus route, provides the path for Pro-Bot to drive on. As the Bot drives along the path, it is required to make angular turns at each point. I have provided the angular measurements required in degrees and distances in centimeters. The bus travels in a loop, the directions are shown using arrows. Note that the map below is not drawn to scale.





Based on the above map, write a program for Pro-Bot to drive along the following paths, assuming that the Pro-Bot is facing in the forward direction:
  1. The path from the Entrance of the zoo to the African Savanah. How many turns did the Pro-Bot make? Were the angles acute, obtuse or right angles?
  2. To continue from the African Savanah (where you stopped before), to the Elephants enclosure, how many degrees did the Pro-Bot turn? 
  3. Program the path from the African Savanah to the Raptors. How many turns did the Pro-Bot make? Were the angles acute, obtuse or right angles?
  4. Continue the path from the Raptors to the Kids' Play Area. Did you use acute, obtuse or right angles for the turns?
Alternatively, the kids can be asked to program the entire bus route as a single program, marking the types of angles used along the way.


Monday, August 18, 2014

Sensors in Pro-Bot: Relay Driving by Pro-Bots using Sensors

Pro-Bot has three kinds of sensors built into it: touch, light and sound sensors. Before we start writing programs for Pro-Bot that use the sensors, let’s see what purpose these sensors serve and what “sensing” means.

Sensing 


When someone taps your shoulder, how do you know you were touched? When the light bulb goes on in a dark room, how do you know the room suddenly got bright? When you put a candy in your mouth, how do you know that it is sweet? Because your skin sensed the touch, or your eyes sensed the light, or your tongue sensed the taste… Once you sense something, you typically react to it, don’t you? When you sense the touch, you may turn around to see who tapped your shoulder; when you sense the light coming on in the dark room, you may squint your eyes and try to figure out what is in that room; when you sense the sweetness on your tongue, you may feel happy and say “yummy”…

Your skin, eyes, tongue, etc., have “sensors” that sense some “stimulus” like touch, light, taste, etc., and enable you to respond to it. You may have also noticed that you have different sensors for different functions. Sensors are made to detect very specific stimuli. For example: your skin doesn’t see, you have eyes to do that; your eyes don’t taste the sweetness of the candy, you have taste buds on your tongue to do that.

Now what if a robot could behave similarly (it may not behave in exactly the same ways as you do)? A robot can be fitted with sensors and programmed to respond in a certain way when the sensor senses a stimulus.

Pro-Bot has 3 kinds of sensors - one senses light, one senses contact (or touch) on its front and rear bumpers and the other senses sound. Pro-Bot’s sensors must be turned on, if you want them to detect stimuli and respond to them (they are switched off by default). Think of it as needing your eyes to be open to see the light. The sensors detect only the specific stimuli that they are designed for. For example, the touch sensor or the light sensor on Pro-Bot will not detect or respond to sounds. They will respond only to touch and light stimuli respectively. However, short sharp sounds (like a loud clap or a short yell) may be detected by the sound sensor and you can program the robot to respond to it.

Now, how does Pro-Bot react when these sensors sense something? Consider the touch sensors on Pro-Bot’s front and rear bumpers. You can program Pro-Bot to do something when those sensors sense a contact (such as bumping into something, or getting bumped by something). Similarly, the light sensor on Pro-Bot can be programmed to do something when it detects a change in lighting.

Pro-Bot has 5 specialized Procedures that correspond to inputs from its sensors. These are 
33 FRONT
34 REAR
35 DARK
36 LIGHT
37 SOUND

You can access and modify the above Procedures via the Menu button on the control pad. The instructions in each of these Procedures will be executed when the the corresponding sensor detects a stimulus. If the Procedure corresponding to the sensor is empty (if you decide not to react to a stimulus), Pro-Bot does not respond to changes in the sensor condition. 
So, what happens after Pro-Bot has responded to a stimulus? Before you answer that question, consider this scenario: Imagine that you are sitting in your chair and reading a book. Your friend comes over, taps you on the shoulder and asks you something. Your skin’s touch sensor senses the tap, and your ears (another of your sensors), sense the spoken words. Maybe your friend was asking you to join her in a game. Let us say you respond saying “Later”. What do you do next? You would continue reading that interesting book, right? 
Let’s analyze what just happened. You were doing something… then you got “interrupted” by your friend… you “handled” that interruption… and then you got back to doing your reading… A computer or a robot can react the same way. When its sensor detects a stimulus, Pro-Bot can react to it by running a specific program, and after it is done, Pro-Bot continues with what it was doing before the interrupt happened. For example, if Pro-Bot was driving and midway, it entered a dark tunnel, it would detect the change in light and may turn on the headlights (if you programmed it to respond that way) and after that, it would continue driving along. After it is done with the response to the stimulus, Pro-Bot resumes the steps in the main program. 

What you have learned above is a fundamental behavior in Computer Science and Robotics: handling interrupts

Let us test our understanding now with an assignment that uses sensors.



Relay Driving by Pro-Bots using Touch Sensors:


Computer Science Concepts involved:   Procedures, Sensors to detect and react to stimuli, a quick peek into Interrupt handling

Math Concepts Involved:   Linear measurements, Solving real world problems by modeling with mathematics

Grade Levels:   3, 4, 5

Hours Required:   1

Materials Required:   A pre-set path drawn for the Pro-Bot to drive on, preferably marked with blue tape. Optionally, a shoebox with one vertical side cut open to act as a garage for Pro-Bot


Programming Assignment:


Let’s look at a simple task to start off with, involving 2 Pro-Bots. The steps are listed below.
  1. Mark a path on the floor with blue tape that is about 40 cm long. You can also mark a target finish line at the end of the path.
  2. Place one Pro-Bot at the beginning of the path, facing forward and ready to drive along the path. 
  3. Place the second Pro-Bot at approximately the midpoint of the path, 20 cm away from the start point, facing forward and ready to start driving. (Both cars face the same direction.)
  4. Optionally, place a ‘garage’ (made out of an upside down shoe box with one side cut for the car to enter) at the very end of the path.
  5. Make sure that the sensors are set to "On" from the Menu button on Pro-Bot.
  6. Program your Pro-Bots so that the first car starts driving along the path while the second car is waiting. The first car hits the back of the second car, makes a beep sound and stops. The second car now starts driving. It drives all the way into the finish line/ garage. It makes a beep sound and stops. (Optional step: when it gets inside the garage, it switches its headlights on.)


Now, how can we program the two Pro-Bots to do this?
  • For the first Pro-Bot, the task involves driving forward, say 20 cm, to reach the second car and then reacting to a touch on the front bumper when it hits the second Pro-Bot. So, your program for the first Pro-Bot has to be split up into two parts - the Main program that handles the driving forward part and Procedure 33 FRONT that handles the contact to the front sensor. You will have to edit Procedure 33 FRONT to make the beep sound & add in a few Pause instructions to make the car stop.
  • For the second car, driving starts only when it gets hit on the rear bumper. To make the car wait, your Main program shall have a few Pause instructions in a loop. You would also need to modify Procedure 34 REAR to make the car react to the hit on the rear bumper and drive to the finish line/ garage. Optionally, once inside the garage, the light sensor can detect the darkness and respond to it; for this modify the procedure 35 DARK to switch on the lights.

Once the two Pro-Bots have been programmed, press the GO button on both cars at the same time and watch the relay race happen! Here is a sample set of programs, for two Pro-Bots kept at a distance of 20 cm from each other and the finish line at a distance of 20 cm from the second Pro-Bot:



Pro-Bot 1:

  • Main - Fd 20

  • 33 FRONT -  Sound 3
                              Rpt 20 [
                              Ps
                              ]

Pro-Bot 2:

  • Main - Rpt 20 [
                   Ps
                   ]

  • 34 REAR -  Fd 20
                           Sound 3

  • Optionally, 35 DARK - Light On

Note:   This project can be easily extended to include more cars and more complicated paths. Since we do not have a Stop instruction available, we can make the car stop by using the Pause instruction in a loop. 


Extension


If working on the relay race project with 3 or more cars, all the cars other than the first and last ones would need to handle both their front and rear touch sensors. Let’s look at an example with 3 cars, assuming they are kept at a distance of 20 cm each. In this case, the first car would behave as Pro-Bot 1 above and the last car would behave as Pro-Bot 2 above. Here is a sample set of programs for the 3 car relay race:


First  Pro-Bot :

  • Main - Fd 20

  • 33 FRONT -  Sound 3
                              Rpt 20 [
                              Ps
                              ]

Middle Pro-Bot:

  • Main: Rpt 20 [
                  Ps
                  ]

  • 34 REAR -  Fd 20
                           Sound 3
                                
  • 33 FRONT -  Sound 3
                              Rpt 20 [
                              Ps
                              ]

Last Pro-Bot :

  • Main - Rpt 50 [                     // Remember to make the Pro-Bot wait longer 
Ps // here to allow for the other two cars to catch up.
                   ]

  • 34 REAR -  Fd 20
                           Sound 3

  • Optionally, 35 DARK - Light On




Sunday, August 17, 2014

Nets of 3D Shapes Part 1- Cubes: More practice with Procedures using Pro-Bot

This programming assignment is intended to provide more practice with Procedures using Pro-Bot. We shall use a Procedure to store the program for a square. We shall then write programs for Pro-Bot to draw nets of a 3-Dimensional object, a cube in this case, using the Procedure. 


Computer Science concepts involved:   Sequential programming, Repeat loops, Nested Loops, Procedures

Math concepts involved:   Cubes; Nets of 3D objects: visualizing cubes on a 2D plane, identifying multiple nets per cube, properties of nets of a cube; Squares, Measurement, Angles

Material required:  Card paper/thin cardboard to draw the nets on

Extension activity:   Make the cube by cutting out the net from the card paper and folding along the edges 

Grade levels:   3, 4

Hours required:   2 (or more)


Nets of 3-Dimensional Figures


A 3-Dimensional (3D) shape is a shape that has length, width and depth. They are also called solid figures or solid shapes. The length, width and depth are the three dimensions. Most of the objects that we see around us are 3-Dimensional. For example: your books, school bag, a box of crayons, Pro-Bot, table, chairs, water bottle, soccer ball, even yourselves are all 3D shapes.

How do these shapes differ from 2-Dimensional (2D)  figures, like the ones that you draw on paper? Think about how a cube or a sphere differs from a square or a circle drawn on paper. Well, the difference is that they have depth, unlike the 2D figures drawn on paper, which have only length and width. 3D shapes do not lie flat on a plane surface and they are difficult to draw on a piece of paper. 

But what if we could open up the 3D shapes and lay them out flat on paper? This would show us exactly how these solid shapes are made. A net can help us convert a 3D shape to a 2D figure. Nets are the flattened shapes of 3D objects. The net shows every edge and every face of the 3D figures laid out flat on paper. The net has only length and width; it does not have depth. It makes it easier for us to study and analyze some of the properties of a 3D object. You can cut out the net from the paper and fold it along the edges to create the 3D object. The same 3D object may be flattened into more than one net.

Let’s look at a very common 3D shape, a cube, and draw its nets. We shall use Pro-Bot to draw the nets on thin cardboard. You can then cut out the nets and fold them to create the 3D object.


Nets for a Cube


Have you seen the dice that you use for board games? It has the shape of a cube. A cube is one of the most common 3D figures, with 6 square faces, 12 edges and 8 vertices. 

What would the cube look like if you cut it open along some of its edges and laid it out flat on a piece of paper, so that you can see every face and every edge? The flattened version of the cube would be its net. There can be more than one net for a given 3D shape. Can you guess how many nets exist for a cube?

In the figure below are a couple of nets for a cube of sides 6 cm each. 




















You can see from the figure that each net is made up of multiple squares; each square representing a face of the cube. All the squares are similar, with edges measuring 6 cm each. If you fold the above nets along the edges/lines drawn in the figure, you would end up with a cube.



Programming Assignment


  1. Write a program to draw a 6 cm side square. Remember to use Repeat Loops in your program for the square. Store your program as a Procedure.   (Since the same square is used multiple times in each net, it would be easier for you as the programmer, to write the program for the square just once, store it in a Procedure and then call that Procedure from your main program whenever you need it.) 
  2. Write the programs for Pro-Bot to draw the nets for the cube as given in the figure above. Use the Procedure for the square that you previously wrote while writing the programs.
  3. There are 11 possible nets for a cube, two of which are given above. Can you identify the other 9 nets for the cube as well? 
  4. Write a program for Pro-Bot to draw each net that you identify, using the Procedure for the square in your program.
  5. Once you are done drawing each net using Pro-Bot, cut out the nets from the paper. Fold the paper along the lines drawn and create a cube from each net.You could even draw the numbers/dots on the six squares as seen on a pair of dice. 
  6. List the properties that seem to be common for the various nets that you came up with.
  7. Compare the area and perimeter of the different nets. 



Friday, August 1, 2014

Drawing Polygons using Pro-Bot given Area or Perimeter

In this programming assignment, we shall draw polygons using Pro-Bot, given the area or perimeter of the polygons. Your first task is to figure out the dimensions of the polygons from the given data and your second task is to write programs to draw the polygons using Pro-Bot. You can use either sequential programming or Repeat loops to draw the polygons, depending on whether they are irregular or regular.

Computer Science concepts involved:  Sequential programming, Repeat loops

Math concepts involved:  Polygons (regular and irregular), Area, Perimeter, Measurement, Angles

Grade levels:  4, 5

Hours required: 3 - 4


Draw Polygons using Pro-Bot given the perimeter:

  1. The perimeter of a regular, 4 sided polygon is 32 cm. The interior angles are all 90 degrees each. Can you write a program for Pro-Bot to draw this polygon? What kind of a polygon is it?
  2. The perimeter of a regular, 4 sided polygon is 32 cm. A pair of opposite interior angles are 60 degrees each. Can you write a program for Pro-Bot to draw this polygon? What kind of a polygon is it?
  3. The perimeter of a regular 3 sided polygon is 18 cm. The interior angles are all 60 degrees each. Can you write a program for Pro-Bot to draw this polygon? What kind of a polygon is it?
  4. The perimeter of a 3 sided polygon is 24 cm. The interior angle between the shortest sides is 90 degrees. The interior angle between the shortest and longest sides is 54 degrees. The sum of the lengths of the shortest sides is 14 cm. The difference between the lengths of the shortest sides is 2 cm. What kind of a polygon is it? Can you write a program for Pro-Bot to draw this polygon? 
  5. The perimeter of a 4 sided polygon is 24 cm. Two of its sides are parallel to each other and the other two are not. The sides that are not parallel are equal in length. Both the angles coming from a parallel side are equal: the pair of angles coming from the longer parallel side is 54 degrees each and the pair of angles coming from the shorter parallel side is 126 degrees each. The sum of the lengths of the parallel sides is 14 cm. The shorter of the parallel sides is 4 cm. Can you identify the polygon? Can you write a program for Pro-Bot to draw this polygon?
  6. The perimeter of a 4 sided polygon is 24 cm. Both sets of opposite sides are parallel. What kind of a polygon do you think it is? The ratio of the shorter side to the longer side of this polygon is 1/2; i.e.; each shorter side is half the length of the longer side. One pair of interior opposite angles is 60 degrees and the other pair of interior opposite angles is 120 degrees. Can you write a program for Pro-Bot to draw this polygon?
  7. The perimeter of a 5 sided regular polygon is 25 cm. Can you write a program for Pro-Bot to draw this polygon? What kind of a polygon is it? What is the value of each interior angle?

Drawing Polygons using Pro-Bot given the area:


  1. The area of a regular, 4 sided polygon is 24 square cm. The interior angles are all 90 degrees each. Can you write a program for Pro-Bot to draw this polygon? What kind of a polygon is it?
  2. The area of a 4 sided polygon is 24 square cm. The opposite sides are equal in length and the interior angles are all 90 degrees each. The longer side measures 2 cm more than the shorter side. The sum of the lengths of the long side and the short side is 10 cm. Can you write a program for ProBot to draw this polygon? What kind of a polygon is it?
  3. The area of a 3 sided polygon is 24 square cm. The interior angle between the shortest sides is 90 degrees. The interior angle between the shortest and longest sides is 54 degrees. The sum of the lengths of the shortest sides is 14 cm. The difference between the lengths of the shortest sides is 2 cm. What kind of a polygon is it? Can you write a program for ProBot to draw this polygon? 
  4. The area of a 4 sided polygon is 24 square cm. Both sets of opposite sides are parallel to each other. What kind of a polygon is it? The distance between the longer parallel sides is 4 cm. The perimeter of this polygon is 20 cm. One pair of interior opposite angles is 60 degrees and the other pair of interior opposite angles is 120 degrees. Can you write a program for ProBot to draw this polygon?

Wednesday, July 30, 2014

Procedures in Pro-Bot


Let’s start this lesson by taking a look at your typical school day. What are some of the functions that you perform on a given school day? Here are a few: you wake up, make your bed, brush your teeth, take a bath, get dressed, eat breakfast, travel to school, study, play, eat lunch, study again, travel home, play, sports/activities, watch TV, read a book, do homework, eat dinner, brush your teeth, sleep... If you look closely at each of these functions, you notice that each one of these involves multiple steps.

For example, brushing your teeth more or less involves the following steps: (1) pick up toothbrush (2) pick up toothpaste (3) squeeze the toothpaste onto the brush (4) actual brushing of the teeth (5) open the tap for water (6) fill up your glass (7) close tap (8) rinse your mouth (9) put away the toothbrush and toothpaste.

We bunched up all these steps and gave it a unique name: “brush teeth”. When your dad or mom wants you brush your teeth, do they say all these 9 steps one by one, or do they just say “brush teeth”? Why? Because you understand what “brush teeth” means. You have been taught in your younger days what that means and how to do all those 9 steps. All those steps are in your memory. So when you hear it, you know all the steps to do.

Now let us take a look at a computer… like your Pro-Bot. Don’t you think if a computer is first told how to draw a 6 cm side square, then each time you want to draw a 6 cm side square, you should be able to say a unique name like “square” or draw square”, or something like that, instead of telling it each time “Fd 6, Rt, Fd 6, Rt, Fd 6, Rt, Fd 6, Rt”? Guess what? The computer can do that! And that is what we call “Procedure”.

A procedure is a set of computer program instructions that performs a specific task.
  
In your daily life example, “brush teeth” is a procedure. It is a small group of instructions that performs a specific function. Any time your parent wants you to perform this function (which involves those 9 steps), he or she would just call it by the name “brush teeth”, rather than specify every step involved in it. This way, they get to reuse the “procedure” they taught you and made you memorize. Similarly, in a computer program, you write those steps once into the computer’s memory and give it a unique name. Then you can use it multiple times in your program.

Maybe, the dentist has advised you and your parents to include flossing into your routine. Flossing is also a procedure just like “brush teeth”. It involves some of these steps: (1) take the box of floss, (2) cut off about 10 inches of the flossing thread (3) coil it around your fingers (4) insert it between 2 of your teeth and pull (5) repeat this for all the gaps between your teeth (6) uncoil the string from your fingers (7) throw it into the garbage. Your parents work with you to teach you these steps until you have learned it. Then while brushing your teeth, he or she may remind you to “floss”. They don’t have to tell you all those 7 steps every time anymore. So here you can see that the “floss” procedure is called from within the “brush teeth” procedure.

Now let’s go back to the computer. Let’s say you want it to make a beeping sound after you draw the square. What would you do? You could write a procedure to make that beeping sound. Then call that “beep” procedure from within your “square” procedure after all those steps to draw the square. In this way, you just easily modified your first procedure to do something different.

Thus, you can call other procedures from within a procedure.

Back to our “brush teeth” example. You may decide to floss before you do other steps in your “brush teeth” procedure, or after you have done those steps. Similarly you may decide to make the Pro-Bot “beep” before it starts drawing the square instead of after drawing the square. Can you see how easy that would be? You just have to call the “beep” procedure first instead of last within your “square” procedure.

You can think of “school day” as a Program, and functions like “wake up”, “make bed”, “brush teeth”, etc., as Procedures inside the program. Now, try writing two different programs using the procedures for the daily functions: one program for a school day and the other program for a holiday. You can easily see that you would not call every one of the procedures for either program. There might be some procedures that are common to both programs and there might be some that are exclusive to each. Such as, you don’t “travel to school” on a holiday, but you “brush teeth” every day. You might also call them in different orders for the two programs. For example, you may watch TV at different times during a holiday, than on a school day.

Procedures thus help us to customize our programs easily.

We already mentioned that procedures and programs can call other procedures from within. They can be called multiple times as well. You can write a procedure for drinking water. You might call this procedure multiple times throughout the day, while performing other functions. This means that you can call “drink water” from within your “eat lunch” procedure or from within your “play” procedure or from within your “do homework” procedure, etc.


How to create and edit a procedure for Pro-Bot
Pro-Bot lets you create and store up to 32 procedures in its memory. In the case of Pro-Bot, these procedures are named Proc 1, Proc 2, …, …, Proc 32.
Pro-Bot’s Menu button provides two options to access procedures:
·      New Proc
·      Edt Proc

Let’s discuss each of these options.
1.   New Proc:
Press the Menu button & then scroll down to “New Proc”. Choose this option when you want to create a new procedure. It will show you a list of 32 procedures on the screen. Choose any procedure name from this list (Proc 1 to Proc 32). Let’s say that you choose Proc 3. Your Pro-Bot screen will now show Proc 3. Type in the instructions for the specific function that you want Proc 3 to perform. Next, press Menu. This will take you back to the Main program. You can now call Proc 3 from your Main program anytime you want to use it. You do this by pressing the “Proc” button and then the number key 3.

2.   Edt Proc:
Press the Menu button & then scroll down to “Edt Proc”. Choose this option when you want to edit a procedure that you created earlier. It will show you the list of 32 procedures on the screen. Choose the procedure that you want to edit from this list. Let’s say that you choose Proc 3. Your Pro-Bot screen will now show the instructions that you put in earlier for Proc 3 (or an empty program if you put in no instructions earlier). Make the changes that you want for this procedure. Next, press Menu to go back to the Main program. You can now call Proc 3 from your Main program and it will provide you with the updated functionality.

For example; you can write a procedure to draw a square of side 6 cm. Let’s say we name this procedure “Proc 1”. Proc 1’s code will be “Rpt 4 [ Fd 6   Rt ]”. You can store this procedure in memory and anytime you need to draw a 6 cm square, you just call Proc 1 from your Main program.


In addition to the 32 procedures that you can create and edit, Pro-Bot also provides 5 other procedures with pre-defined names related to the touch, light & sound sensors. You can edit these using the Edt Proc option from Menu. These procedures are:
·      33 FRONT (runs when the front touch sensor is triggered)
·      34 REAR (runs when the rear touch sensor is triggered)
·      35 DARK (runs when the light sensor goes from light to dark)
·      36 LIGHT (runs when the light sensor goes from dark to light)
·      37 SOUND (runs when the sound sensor is triggered)

There are also 3 built-in, pre-defined procedures that you cannot edit, but can call from Main. These are:
·      38 HEXGN: draws a hexagon
·      39 DIAMND: draws a diamond
·      40 FLOWER: draws eight diamonds using Proc39

Note: You can call other procedures from within any other procedure. Just take care not to run procedures that call each other, in which case you would get into an endless loop.