Tiger 70709 manual Programming Getting Started, Programming Exercises, Testing

Page 25

PROGRAMMING: GETTING STARTED

Programming Exercises

In this section you will learn how to write programs to make your WonderBorg move.

Exercise 1: Creating a Program that Simply Makes the Robot Go Forward

We’re now going to program the WonderBorg to continuously walk forward, like toy robots.

Panel 1

If there is no sensor reaction, the WonderBorg will take one step forward. By repeating this action, it will move forward continuously. Even if its antennae touch something, it has not been told what to do in this situation, so it will just keep going forward.

Testing

The next step is to send the program to your WonderBorg, and make it execute the program. Turn the WonderBorg’s POWER switch ON, place it in front of the Interface, and click the "download to robot" button at the top right of the Panel screen. If the WonderBorg gives a short beep, the transmission has been completed successfully. If you now press the START/STOP button on the WonderBorg’s back, the robot will start moving. To stop the robot when it is moving, press the START/STOP button again.

47

PROGRAMMING: GETTING STARTED

Exercise 2: Modifying the Program so that the

WonderBorg can Avoid Obstacles

We’re now going to modify the program from Exercise 1 so that the WonderBorg will use its touch sensor to detect obstacles, and take evasive action.

Panel 1

Add this section to the program from Exercise 1

Here, the program for Exercise 1 is augmented with commands to be executed if the antennae reacts. If the right antenna reacts, the robot is instructed to back up and rotate to the left, and if the left antenna reacts, to back up and rotate to the right. If both antennae react at the same time, the upper sensor block takes priority. In this case, the right antenna is prioritized, so the robot will back up and rotate to the left.

Testing

It is now time to test the program. By making the WonderBorg execute this program in various different locations, you will be able to find out what works best in terms of the number of steps taken when going backward and when turning. You can alter the numbers in the program very easily by double-clicking the appropriate command block and then typing in the new number.

Although this program uses the touch sensors, the infrared sensors can also be used in the same way. Try replacing "right antenna" with "something on the right", and "left antenna" with "something on the left". Again, the numbers can be altered very easily just by double-clicking the appropriate block and typing in the new number.

48

Image 25
Contents Item No Introduction Contents Configuration of the Wonderborg WonderBorgs Intelligence Program How to Make the WonderBorg WorkNames of Parts Hardware BasicsTools Required List of PartsSet of Rubber Parts with runners BasicsOther Parts Fitting the Legs Installing the MotherboardFitting the Antennae AAA/LR03 Extra InformationChanging the Gears Hardware VariationsSpecifications Assembly Variations Option connectorPin Layout and Reference Circuit Robot Works Contents Installing the software SET UPIntroduction IntroductionUsing the Interface as an Infrared Signal Transmitter Connecting the InterfaceNames of Interface Parts and Their Function Points to noteOverview of the Programming Operation Setting the serial PortLets get started Command Block Factory How to Read the ScreensPanel Screen Sensor Block FactoryPanel Screen Programminng Sensor Block Factory How to Create a Sensor BlockFrequently-Used Sensors How to Create a Command Block Command Block FactorySensor Table Names of PartsPriority Order and Interrupts Transmitting a Program To the Wonderborg SET UP ScreenSending a Program to WonderBorg Saving a ProgramIR signal Control Send Set UpReturn Programming Getting Started TestingProgramming Exercises Ranged Reached by the Infrared Signal How to Transmit an Infrared SignalProgram for Exercise PanelSoftware License Agreement Troubleshooting Operating Problems TroubleshootingProblems with Program Transmission Problems with SensorsDay Limited Warranty WarrantyAppendix Template for Legs and AntennaeFCC Statement