Application Programs

GNU assembler (for PC and UNIX) or C compiler (for PC and UNIX) can easily be used. For information see the GNU Manual Page. However, other compilers or assemblers for 68,000 may be used as well. To download compiler and assembler use the EyeBot ftp server.

You can either write your own assembly programs or your own C programs to control EyeBot. Your C programs should make use of the EyeBot libraries, which prepares functions for display output (text or graphics), camera input (grayscale or color), sound output, and servo control (motors). Clib functions like "printf" or "getchar" may be used instead of "LCDPutString" and "KEYGet", resp., but please keep in mind that this will link additional library functions and results in a longer executable program.

How to Create an Application Program

Programming in C

Edit the C source file (e.g. demo.c) like the following:
#include "eyebot.h"
#include <stdio.h>

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

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

Programming in Assembly

Edit the assembly source file (e.g. hello.s) like the following:
    .include "labmac.i"
    .section .text
    .globl main

main:  LEA hello, A0          | load string address
       CALLEXEC LCD_PutString | call assembly routine

hello: .asciz "Hello !"
Please note that some gnu assembly conventions differ from the Motorola standard:

Combining C and Assembly Programs

You may combine several C and assembly programs to form a single executable. There are two ways of doing this:
Thomas Bräunl, 2001