Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: SuperMiguel on June 20, 2012, 04:12:17 PM

Title: Axon Questions
Post by: SuperMiguel on June 20, 2012, 04:12:17 PM
So i just got my axon and i have a few questions about it...

When i build the code it has many .c files ope_devicenames.c, gen_clock.c, etc are all these files needed?

Also how is this my main???

TICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart) 

??
Title: Re: Axon Questions
Post by: SuperMiguel on June 20, 2012, 08:42:45 PM
any one?
Title: Re: Axon Questions
Post by: Gertlex on June 20, 2012, 11:07:20 PM
Sounds like you're using Webbotlib, which is a good thing :)

The .c files are all necessary, or webbotlib wouldn't have generated them.  Initially, to avoid headaches, stick to doing all of your own coding in one .c file, with .h files if you know how to use those...  I recommend keeping each project in its own folder. You'll run into problems if you do otherwise.

Ultimately, there really is a main function buried somewhere.  Using appControl as your 'main' just works.  Note that you can do
Code: [Select]
return 50000;which will cause appControl to run every 50 ms.  This lets you control how often your code loops while saving you the headache of dealing with keeping track of time variables.

Hope that helps.
Title: Re: Axon Questions
Post by: SuperMiguel on June 21, 2012, 11:01:17 AM
I feel like webbot hides to much from the user? like if you really want to learn programming i dont think is a good idea
Title: Re: Axon Questions
Post by: Admin on June 21, 2012, 11:43:38 AM
yeap,
TICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart)
is your main.

You can only have one .c file with WebbotLib. Use .h files if you need more files.


Quote
I feel like webbot hides to much from the user? like if you really want to learn programming i dont think is a good idea
It really depends on what your goals are. Some people just want to make a neat robot and focus on high level stuff like line following - they don't want to read the 600 page Atmel datasheet to figure out which bits to flip, how to interface I2C, or have to know what a prescale value is.

If your goal was to learn the low-level details, you don't want to use a library. Just a text editor and a compiler would be fine.

But in the end, you only have 24 hours in a day, so more time focused on learning low-level stuff means less time spent learning high-level stuff.
Title: Re: Axon Questions
Post by: Gertlex on June 21, 2012, 04:48:19 PM
Like Admin said, it depends on your goals.  Or your definition of learning programming.

In my case, I'm content to leave the hardware stuff that Webbotlib handles alone.  The programming logic that remains is what I tend to think of as programming, and much closer to the programming that I do as an (non-robotics) engineering grad student.