# First Steps

A Beginners' Guide

#### Before you start make sure to read the documentation.

- Read through the whole documentation on paper or online.
- Make sure you understand it by having the EyeBot next to you.

#### Switching it on.

- Get a regulated power supply or batteries of approx. 7.2V
- Check the polarity before connection - wrong polarity may damage the EyeBot.
- With power connected switch on the EyeBot (black switch on bottom right).
- You should now be greeted by the EyeBot logo on the graphics screen

  and a "Ready" sound from the built-in piezo speaker.
  [Sound quality can be greatly improved by connecting a standard 8 Ohm speaker.]
- After about 2 sec., the screen changes and looks something like the following:

      - RoBiOS  Vx.x -
      ----------------
      RobName ID:01
      25 MHz  512K ROM
       896Kf 1024K RAM
       Battery-Status
      @@@@@@@@@@@@@@@@
      <I> Hrd Usr Demo

- Now you can try pressing the four buttons under the LCD. They are called "soft keys", since their meaning changes and the current function is always displayed in the last line of the LCD.
  So right now, pressing
  - the left button stands for "I" or Information
    pressing this button will tell you who contributed to the EyeBot project.
  - the second button stands for "Hrd" or Hardware
    pressing this button selects hardware features like setting parameters, testing all connected hardware and I/O.
  - the third button stands for "Usr" or User
    pressing this buttons allows to download, save, and run user programs.
  - the right button stands for "Demo" or Demo Programs
    pressing this buttons shows a selection of built-in demo programs.
- Now read more in section Operating System.

#### Working with the camera.

- Switch off the EyeBot, then connect the EyeCam camera as described in section Installation.
- Switch the EyeBot on and press the key sequence Demo, then Cam, then Gry
  [abbreviated here as: Demo/Cam/Gry]
- You will then see a black and white image on the screen from the camera
  (you may have to wait a few seconds for the autobrightness to adjust).
- In case of an error (i.g. cable not connected correctly), you will get the message "No Camera!!"
- The LCD can only display black/white (1 bit), while the actual camera image your program can internally work with has 24 bit color (8 bit each for red/green/blue).
- You can now use the soft keys to try several image processing routines in real time.
  See section Demos for details.

#### Working with Motors, Servos, and Infared Sensors

- All motors, servos, and infrared sensors connected to the EyeBot make use of the Hardware Description Table (HDT).
  - HDT description
  - Sample HDT (C file)
- The HDT allows a simple update of the RoBIOS operating system when only a new sensor or motor driver needs to be added. By changing the HDT source file, re-compiling and downloading to the EyeBot, these settings can be customised.
- By pressing Hrd/HDT you'll see a list of components for which the current HDT settings have been configured
  (e.g. 2 motors, 2 encoders, 12 servos, 6 infared position sensitive devices [PSD])
- Assuming motors, servos, or infrared sensors have been correctly connected, it is now possible to test each of them individually.
- E.g. keep pressing "Nxt" until the asterisk is at the line "Servos", then keep pushing "+" until "SERVO7" is displayed. Assuming you connected a servo to connector "S7" on the back of the EyeBot, you can now press "Tst" to test it.
- The servo test menu lets you press "+" or "-" to change the servo angle, "END" will return the the upper menu.
- It is possible to change the max./min. servo angle and the turning direction through the HDT.

#### Writing and Downloading a User Program

- This is discussed in detail in sections Application and Download.
- Install the gnu C compiler on your Windows or Unix system.
- Create a sample file "demo.c" with the following program:

      #include "eyebot.h"
      #include <stdio.h>

      void main ()
      { int k;
        printf("Hello !\n");

        k = KEYGet();
        printf("key %d pressed !\n", k);
      }

- Compile the program by typing "gcc68 demo.c".
  Thias will generate a downloadable file "demo.hex".
- Connect the serial cable between your computer system and the EyeBot.
  Make sure you are using the right port (COM1 or COM2) for your local settings.
- Put the EyeBot in receive mode by pressing Usr/Ld.
- Use "dl demo.hex" on Unix or "Hyperterminal" on Windows to start data transfer.
  Make sure the Baud rates on Computer and EyeBot match.
- You will now see an increasing number, displaying the number of bytes transferred.
- When finished, press "Run" on the EyeBot to start the application program.

#### Upgrading to a New Version of the RoBIOS Operating System

- Copy the latest version of the operating system from http://robotics.ee.uwa.edu.au/eyebot/ftp/ROBIOS/hex/
  and save it on your local disk.
- Download this ".hex" file to the EyeBot just like an application program (see above).
- EyeBot will now ask you whether you want to upgrade the operating system.
  Answer: yes
- EyeBot now rewrites the Flash-ROM, then asks you to press the reset button.
  Press the reset button, located next to the power switch.
- You now finished installing the latest RoBIOS version. The new version number will be displayed in the main menu.
- Copy the whole user package (".tgz") over the web, to update all libraries and include files on your workstation or PC.

Thomas Bräunl 2003