Society of Robots - Robot Forum
Software => Software => Topic started by: Pierre on November 08, 2009, 08:47:32 AM
-
Hi,
I am giving a try testing the Webbot library 1.12 on servos.h using the ATmega8
Using servos.h code from the manual I get many errors and the first is:
error 'D1' undeclared here (not in function);
SERVO left = MAKE_SERVO(FALSE, D1, 1500, 500);
This tells me the iopin D1 is not recognised I am missing a library right?
I have put these library:
libm.a;
libc.a; and
libWebbot-ATMega8.a
Greatly appreciated for any helps
Going to pay my respect to Veterans for Memorial day. Cheers
-
Put the libraries in this order:
libWebbot-ATMega8.a
libm.a
libc.a
Its a 'feature' in AVR Studio that took me forever to figure out. If you still get errors, just copy/paste a few of them.
-
I presume you also added the following to the start of your own program
#include "sys/ATMega8.h"
-
Admin: :) Good to know. I keep in mind
Webbot: :) Thank you. Did it. Although I got errors on these three(3) below:
Timer.h: 198: undefined reference to 'pgm_Timers'
timer.c: 782: undefined reference to ' NUMBER_OF_TIMERS'
core.c: (.text+0x8c): undefined reference to 'appInitSoftware'
It is similar with 'sysInitHardware'
I am sure I am forgetting something simple. I go out the box, relax, drink coffee then think, do some test but no luck.
Before I learned about webbotLib, I was reading your tutorial on servos. This is great knowledge but not easy to get it work but I love it. Right now I am playing with webbotLib so I could test it and hope to use in the futur.
Thank you. I really appreciated the support. :)
-
Send me your source files - ie PM/email me. There's obviously something simple that you've got wrong - but its hard to tell without sight of the source code.
Also - how are you compiling your program? Are you using AVRStudio or have you written your own command line makefile?
-
Yes. Webbot, I am using AVR Studio with AVRISP mkII
'Waitout' I have probably failed to setup my environment correctly.
I have wrote your "My first program" Hello world from the pdf file and came up with 25 errors.
Taking no chance removing and reinstalling both AVRStudio and WinAVR.
-
I have wrote your "My first program" Hello world from the pdf file and came up with 25 errors.
Verify what you copied/pasted is the same as in the pdf file.
Just post your code here, we can help.
-
You have sent me your files and your errors are because you haven't told AVRstudio the correct location of your WebbotLib library files - hence all the errors.
Re-installing AVRStrudio and WinAVR will NOT fix this!! You need to configure the project correctly as described in the getting started section of the manual.
-
Thank you for the help
Three(3) errors left from "My first program" from page 10 of the PDF WebbotLib file.
The three errors are from the same line. I am including two printscreen picture of what I think my be the cause. Could it be the this
From the function in the "rprintf.h"
Writer rprintfInit(Writer writer)
The function looks odd to me
I include two printscreen to help.
Thanks again. It is like babies. Before walking, they need to know how to start properly then there is no stopping. I'll get there and one day I will be worthy to buy an Axon.
-
Ok, its an error that has snuck in for the ATMega8 - but I'm not sure its worth fixing.
As per this post:
http://www.societyofrobots.com/robotforum/index.php?topic=7787.msg71646#msg71646 (http://www.societyofrobots.com/robotforum/index.php?topic=7787.msg71646#msg71646)
The ATMega8 is not really supported anymore as it doesn't have enough memory - so even if I fixed this error then you would get a new one saying the program is too big for the ATmega8.
So I would definitely recommend that you upgrade to an ATmega168 which can just plug in instead of the ATMega8 - ie no hardware changes. The ATMega168 IS currently supported by WebbotLib and is worth the price (couple of bucks). It gives 16k of program.
Alternatively: the ATMega328P is another plug-in replacement but allows 32k of program.
See http://www.societyofrobots.com/step_by_step_atmega168_swapout.shtml (http://www.societyofrobots.com/step_by_step_atmega168_swapout.shtml)
Sorry - if that has caused you
-
Totally right Webbot
WebbotLib is too big for the ATmega8 as I was getting this line.
c:\program files\winavr\bin\..\lib\gcc\avr\4.1.1\..\..\..\..\avr\bin\ld.exe: region text is full
I will adopt the ATMega168. It will work on the $50 robot board.
For the ATMega328P I believe I need to do some modification with the $50 robot board.
-
For the ATMega328P I believe I need to do some modification with the $50 robot board.
No mod required, it'll plug right in.
-
For the ATMega328P I believe I need to do some modification with the $50 robot board.
Nope, the only modifications are for the code, the pinout on the 8, 168 and 328 are all compatible.
So, its a straight drop in.