background image

APPENDIX D. DEMO PROGRAMS

35

buttonTest

With this program, pressing one of the buttons will cause the corresponding LED to light

up.

digitalTest

This program tests all four digital inputs and when a voltage is applied it will cause the

corresponding LED to light up.

lcdTest

This program demonstrates the usage of the qfix LC-display.

lcdChangeID

With this program it is possible to change the logical ID of a LC-display. This is needed

whenever multiple display are connected to the controller board.

ledTest

This program causes the four LEDs to flash in similar fashion to the Knight Rider automo-

bile.

lineFollow

This program uses the qfix line sensor to move along a line.

For this, the line sensor must be connected to analog input 3.

After program start, place the robot next to the line and press button 0. Then, place the

robot exactly on the line and press button 1. Now, button 2 starts the robot.

While moving, the robot can be stopped by pressing button 0. Button 1 starts again.

motorTest

This program controls both motors at 4 different speeds in both directions. The 4 possible

choices can be selected via the buttons.

Содержание crash-bobby

Страница 1: ...www qfix de Instructions Document No D0305005R3...

Страница 2: ...Step 5 Fitting the controller board supports 11 2 6 Step 6 Mounting the wheels 12 2 7 Step 7 Mounting the support wheel 13 2 8 Step 8 Mounting the sensors 14 2 9 Step 9 Attaching the controller board...

Страница 3: ...Compiling a program 26 4 4 Downloading the program into the controller 28 4 5 Creating your own programs 28 A Controller circuitry 29 B Standard Programm 30 C Command Overview 31 C 1 Class BobbyBoard...

Страница 4: ...ucational purposes in schools universities or industry as they are for the advanced hobby modeler who wishes to become involved in the exciting area of robotics In order to keep yourself informed abou...

Страница 5: ...0x5 2x wheel bush 4x controller board support 1x steel wire for pennant 1x holder for steel wire 2x wheel diameter 50mm 1x caster wheel incl threaded pin 11x screw M6x10 3x screw M6x20 10x screw M3x6...

Страница 6: ...tandard battery charger can be used or alternatively the qfix plug in battery charger order No RBAD000 is available 1 3 Interesting extensions The following extensions to the Crash Bobby kit bring eve...

Страница 7: ...equired First of all the small setscrew should be screwed into the side of the wheel bush Next the wheel bushes should be pushed as far as possible into the wheels so that the countersunk screw M4 can...

Страница 8: ...t of all be assembled on the motor mounts The required components are shown in the next picture The motors are located in the large recess of the motor mounts and tightened using the small screws M2x6...

Страница 9: ...rt wheel on the rectangular mounting plate the components shown in the following picture are required The washers are used as distance spacers and are simply placed on to the threaded pin Afterwards t...

Страница 10: ...he sensors can subsequently be screwed on to the base plate they must first of all be assembled on the sensor mounts The necessary components are shown in the following picture The three sensors are e...

Страница 11: ...wed into the base plate The base plate and four controller board supports are required As shown in the following picture two of the supports are screwed into the corner locations of the outermost row...

Страница 12: ...te The following components are required The wheel supports are located directly next to the controller board supports and screwed from above with the screws M6x10 Caution The wheels must be mounted i...

Страница 13: ...BBY 13 2 7 Step 7 Mounting the support wheel Two screws are also required for mounting the pre assembled support wheel The mounting plate is placed on the base plate from above and then screwed on fro...

Страница 14: ...ance sensor will sub sequently be screwed First one of the three screws M6x10 is screwed firmly into the single threaded hole located in the plate Then in the same way as for the support wheel the pla...

Страница 15: ...e front right and left corner holes of the base plate and screwed on from below The longer M6x20 screws are now required in order to screw the pre assembled sensors on to the distance pieces The senso...

Страница 16: ...ontroller board For the attachment of the controller board 4 screws M3x6 are required With these the controller board should be screwed on to the four supports so that the connections for the sensors...

Страница 17: ...required The sensors are connected to the connections An0 to An3 the motors are connected to the connections Mot0 and Mot1 In order that the supplied software will run without any changes being requi...

Страница 18: ...CHAPTER 2 BUILDING THE CRASH BOBBY 18...

Страница 19: ...arts are required The holder for the steel wire is screwed on to the screw of the support wheel which projects upwards Then the pennant sticker can be detached and the steel wire laid exactly on the c...

Страница 20: ...g picture shows the qfix rechargeable battery pack with its components The Velcro strip is simply fixed to the base plate with adhesive the velour strip is positioned on the underside of the battery p...

Страница 21: ...in the main directory of the CD 3 1 Requirements The software can be installed under Windows XP or windows 2000 operating systems The application has not yet been tested for use with older versions of...

Страница 22: ...the installation by double clicking on install bat First of all you will be requested to select the desired language Select e g English and then click on OK In the following description we assume Ger...

Страница 23: ...ly However WinAVR may be uninstalled again at any time and can then be installed cor rectly Confirm your selection by clicking on Continue A window opens for the selection of the components to be inst...

Страница 24: ...ow in order to display additional information for you to read concerning WinAVR You may simply close this program before or after reading the contents Now the compiler is installed 3 4 Installation of...

Страница 25: ...ve the plug and check the connection In order to load a program from the PC into the controller the download cable must be plugged into the parallel port printer connection LPT1 of the PC and the red...

Страница 26: ...ing now 4 3 Compiling a program In order to compile the program for your board the correct controller must be selected The qfix kits currently support the Atmel controllers mega32 mega128 and AT90CAN1...

Страница 27: ...ng the status of the compilation As you can see in the topmost line of the output window the tool c WinAVR compile mega32 bat was called for compilation If the messages compiling and OK occur the comp...

Страница 28: ...the four LEDs blink The same steps compilation plus download can be performed for the other sample pro grams too A list of provided samples can be found in the appendix If there is a problem transfer...

Страница 29: ...lugs The outer pin is the power output It can be swithed on and off by the commands powerOn and powerOff The middle pin is ground The inner pin is the input signal pin For analog input a voltage of be...

Страница 30: ...used as a starting point for own programs First it includes the required library qfixBobbyBoard h and then creates an object bobby This object can be used to invoke arbitrary commands For example the...

Страница 31: ...D The column RValue in the class table describes the type of the return value for each method The following types are used Type Description void No value used as return type in functions with out retu...

Страница 32: ...or int i int speed Sets the motor with index i to the value speed which must be in the range 255 to 255 A value of 0 puts off the motor void motors int motor0 int motor1 Sets both motors to the respec...

Страница 33: ...to the display clears the display and puts the cursor to 0 0 void clear Clears the display void print int i Prints the number i at the current cursor position void print char s Prints the string s at...

Страница 34: ...istance sensors must be connected to the controller as follows Left sensor An0 Middle sensor An1 Right sensor An2 Die Motoren mu ssen folgenderma en angeschlossen sein Left motor Mo0 Right motor Mo1 O...

Страница 35: ...are connected to the controller board ledTest This program causes the four LEDs to flash in similar fashion to the Knight Rider automo bile lineFollow This program uses the qfix line sensor to move a...

Страница 36: ...ording to the command The program code must not be known or understood black box principle In the master program two objects are instantiated bobby and slave It always polls the buttons of the master...

Страница 37: ...APPENDIX D DEMO PROGRAMS 37 Left motor Mo0 Right motor Mo1 KTB mechatronics GmbH Tel 49 7344 929330 Helfensteinerstrasse 26 Fax 49 7344 929331 89143 Blaubeuren Mail info qfix de GERMANY powered by...

Отзывы: