Author Topic: Webbot lib - multiple definitions  (Read 1606 times)

0 Members and 1 Guest are viewing this topic.

Offline chelmiTopic starter

  • Supreme Robot
  • *****
  • Posts: 496
  • Helpful? 15
    • Current projects
Webbot lib - multiple definitions
« on: March 27, 2010, 12:55:06 PM »
Hi guys,

I want to separate my code in several modules and I can't find a way to do that without upsetting the linker :p

Here is my configuration:
- main.c file which include <sys/atmega168.h> to initialize basic stuff like a status LED. It defines the appInit*
and appControl functions.

- scanner.c that defines functions to initialize a servo and a distance sensor. These function are called by the appInit* functions in
main.c

Which file should I include in scanner.c to hat the port definition? (like D0, D1...)

Chelmi.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Webbot lib - multiple definitions
« Reply #1 on: March 27, 2010, 06:44:19 PM »
Easiest is to use a 'scanner.h' rather than a 'scanner.c'

For ease of use, to newbs, the lib expects one C file.

Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

 


Get Your Ad Here

data_list