Robojoy challenge class

2-4-1 Let's make a simple program

  • Page:
  • 1
  • 2
  • 3
  • 4
Make the program

Well, let's create a simple program using ROBOLAB. The first is a program called "move forward for 2 seconds and stop." Operations are needed to make this program; "move forward" "wait for two seconds" and "stop".

To "move forward", what should I do? By rotating in the same direction as the motor force of the left and right, the robot will move forward. Motor to the left and right of the robot for this time, was connected to port B and port C. It should rotate the motor which is connected to the port of B and C will find it. To the right of the green light, and C motor rotation order, place the order B motor rotation.

To "wait for two seconds", what should I do? The number of seconds could be measured by the clock. There is an icon of the clock symbol called "wait" in the "function palette". Click here to "wait palette" will be displayed. From this, use the command icon that is labeled "2S", or click the command icon is labeled "?" on the "Diagram window ".

In the diagram window, 1 has been displayed in the lower right corner of the command icon "?". This state has become the order of "wait 1 second." Changes that number from 1 to 2 will be "wait for two seconds."

Only when you change the number, select the "Tools palette" "index finger (manipulation of the object)", enter the number on the keyboard by clicking the number part.

To "stop", what should I do? You will be good asking to stop the B and C motor. Return to the "function palette" by clicking the arrow on the "wait palette ", you can use the red "Stop B" and "stop C".

Connect reliably one by one from the green light until the red light, the command icon. When you connect the icons, select "Connect the wires" from the "Tools Palette" and connect all wires.

Connection of the wire is make sure to connect the upper right corner of the command and the upper left corner of the icon on the next command. From the green light, will lead in line of pink to red light, it is OK for now.

When the line did not lead in pink, had led in the line of black and white, you need to remove the lines of black and white. This black and white line, called "broken wire", and even a little broken wire that remain, the program will result in an error.

To turn off the "broken wire", choose "Remove broken wires" from "Edit (E)" of the "diagram window". After you remove the "broken wire", certainly, let's connect one by one to ensure the command icon.

After program is created, the arrow in the upper left of the "diagram window" becomes "white right arrow (run) ". If it has not become "the white arrow (execute)", will be "broken arrow (list the error) ".

If you click "broken arrow" then "error list" will be displayed on the screen. When you click the "Errors and Warnings" on this screen, the focus jumps to the part there is a problem in the program, it is surrounded by a line of black and white. In this way, you find the part error, and correct it.

  • Page:
  • 1
  • 2
  • 3
  • 4