Society of Robots - Robot Forum
Software => Software => Topic started by: FPboss_12 on October 01, 2012, 07:22:04 PM
-
Um i am new to programming and am having difficulties with the 50$ dollar robot tutorial could someone please help.
-
If You tell us what difficulties You have, we might be able to guide You through them ;)
-
Ok so when log into avr studio 4 and do everything the tutorial tells me to do the stays bar say "build failed with I error and zero warnings" and I have no idea what to do.
-
Hm...you should have more information than that. Does AVRStudio give you any indication where the error might be? It usually says something like "expected ; before something statement on line 5" or "xyz is not defined on line x" or something. Does it say any of that?
Sometimes, though, error messages can get REALLY cryptic, so try posting what the error is and we'll see what we can do :)
MIKE
-
Undefined reference to 'Main'
make: *** [Photovore_v1.elf] Error 1
Build failed with 1 error and 0 warnings.
I am not sure if that clears anything up but i also lost the make file but the one on this project is fine aslong as i dont change it.
-
Hm, an "undefined reference" means you told the computer to look for something that isn't there: in this case, it's likely a function called "Main". Can you post the code?
Main is a special function in the C language that means "whatever you do, do it here first" :-P It's the "program" part of the program, and it's really hard (though not strictly impossible...) to make a C program without having a main function. In fact, if you go through a few "hello, world!" tutorials, you'll see that the first thing you'd need is the "main" function.
Are you using webbotlib or anything like that?
MIKE
-
I am using everything he posted for the 50$ dollar robot tutorial so i really dont know. Im new at this stuff.
-
Hm, well, checking out that tutorial, it looks like you're going to need to make sure:
1) all of your configuration options are set properly: the company that makes the chip you're working with makes a LOT of chips. It's important that the software knows which chip you're using, because it has to change things around to make sure it works with yours.
2) You need the correct makefile. Makefiles tell AVRStudio what to do with the code you wrote, including what things are needed to make it run. They are strangely complex :-P But without one the code won't work, and might have those undefined references.
3) Make sure you are adding the correct header files (like in the tutorial). Header files are like extra instructions that are helpful to all be in one place. But without them, the computer won't have enough instructions to do what you're asking it to do!
4) If you've already done ALL of that, and you're absolutely sure that you didn't touch ANYTHING in the code, something is wrong with your version of AVRStudio. Which version are you using? Some of them just...fail for some reason that has *never* made sense to me :-( 4.19 hates me, and 4.18 seems to be OK but temperamental. Lots of people have talked about good things with 4.13. On the upside, if it is your copy of AVRStudio, then you're doing everything right!
Let me know how it's going!
-
Thanks that helped just one more thing I don't think I have the proper make file and I don't know how to get it back. I am using avr studio v4.14
-
The makefile should still be in the zip file. Just redownload. It is...super important to have the correct one there, and that's probably the cause of your error.
I often find when I'm starting a project that I'm not sure about, I'll make a whole bunch of mistakes, get it to a stage where, although I've learned a lot I don't really want to spend time recovering it, and then just restart. It'll go much faster now that you've done it once and know what you're doing. That way you can be sure that you're following the instructions again! Plus, when you start doing this on your own, it'll help a lot to have the experience starting a whole bunch of projects.
MIKE
-
Alright thanks so much ill let you know how im doing :)
-
I am still having problems. When you download the source file what is the exact name that the file is called because i cant find it under Photovore zip.v1
-
it should be called "Photovore_v1.c", and it lives in the zip file...
-
It definetly made me go farther but this is the error
gcc pug-in: Error:Object file not found on expected location. (My File Name Here)
Make sure your makefile specifies the output .elf file
-
Are you sure you're following the instructions EXACTLY? ie: making sure every file is in the right folder, making sure the makefile is in the right place and your AVRStudio knows where to find it?
It sounds like AVRStudio isn't finding the right files. Is everything unzipped?
MIKE
-
What do you mean by Unzipped and do you think i should try avr studio 13 maybe
-
Ugh still no progress
-
make *** no rule to make target photovore.v1.elf. no idea what .elf is
-
Hm, I'm not sure what's going on, to be honest. You should have downloaded a zip file that contains a lot of source files, right? That should also include a makefile and the photovore_v1.c code. Did you download that zip file? It's here: http://www.societyofrobots.com/downloads/sbs_source_photovore_v1.zip (http://www.societyofrobots.com/downloads/sbs_source_photovore_v1.zip)
That should have everything you need?
MIKE
-
I finally fixed thank you so much but if you would like could you also guide me through the pony prog part cause i am lost on that too :P
-
Great! Unfortunately, though, I've never used pony prog (I use an in-system-programmer made by AVR). Maybe posting your pony prog problems on the electronics part of this forum will get you people who know more about it!
Glad to hear it's working!
MIKE
-
Ok i will, just my only problem is that he has a different kind of compputer and when i have to go into the settings to change everything the ption is not ther :(