go away spammer

Author Topic: programming in AVR studio  (Read 12163 times)

0 Members and 1 Guest are viewing this topic.

Offline dellagdTopic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 731
  • Helpful? 5
  • Come to the dark side... We have cookies!
    • Exodus Rocketry
programming in AVR studio
« on: February 15, 2010, 02:16:04 PM »
I'm getting this error in AVR studio with my current robot project. plz gimmie a little slack since this is my first time using AVR studio when I make the code, not admin. the error says "make: no rule to make target `../omnibot_wall_follow.c' , needed by `omnibot_wall_follow.o' . Stop." what is the problem? thats the only error I get when I click build. actually, heres a screenshot.
Innovation is a product of Failure, which leads to Success.

If I helped, +1 helpful pls

I Won!
3rd place! I'm taking $100

Offline Razor Concepts

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
    • RazorConcepts
Re: programming in AVR studio
« Reply #1 on: February 15, 2010, 02:40:11 PM »
Hmm sounds like a makefile error. I'm not sure how to fix it, I hate makefile errors  :P

Offline dellagdTopic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 731
  • Helpful? 5
  • Come to the dark side... We have cookies!
    • Exodus Rocketry
Re: programming in AVR studio
« Reply #2 on: February 15, 2010, 03:18:30 PM »
well how do I set up a makefile? I have just left it at the defualt, like this-
Innovation is a product of Failure, which leads to Success.

If I helped, +1 helpful pls

I Won!
3rd place! I'm taking $100

Offline dellagdTopic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 731
  • Helpful? 5
  • Come to the dark side... We have cookies!
    • Exodus Rocketry
Re: programming in AVR studio
« Reply #3 on: February 15, 2010, 04:32:57 PM »
heres the code too (dont tell me if it will work for following a wall I'd like to figure that out myself but am I missing something that might make that error stop coming up?

Code: [Select]

#include "sensors/distance/sharp/GP2.h"
#include "sensors/distance/ping/PingSonar.h"
#include "actuators.h"
#include "servos.h"

#include "sys/axon.h"

#include "a2d.h"
#include "uart.h"
#include "rprintf.h"
#include "pwm.h"


// Define two servos

SERVO left = MAKE_SERVO(FALSE, E3,1500, 500);
SERVO right = MAKE_SERVO(FALSE , E4,1500, 500);
SERVO top = MAKE_SERVO(FALSE, E2,1500, 500);
SERVO bottom = MAKE_SERVO(FALSE , E1,1500, 500);
// Create the list - remember to place an & at the
// start of each servo name
SERVO_LIST servos[] = {&left,&right, &top, &bottom};
// Create a driver for the list of servos
SERVO_DRIVER bank1 = MAKE_SERVO_DRIVER(servos);
Sharp_GP2D12 IR1 = MAKE_Sharp_GP2D12(ADC0);
PingSonar PINGsensor = MAKE_PingSonar(F0);

int IR1read;
int PINGread;

void  away_from_wall(void)
{//move away from wall
act_setSpeed(&left, DRIVE_SPEED_MAX);
act_setSpeed(&right, DRIVE_SPEED_MAX);
act_setSpeed(&top, DRIVE_SPEED_MAX);
act_setSpeed(&bottom, DRIVE_SPEED_MAX);

}
void towards_wall(void)
{//move towards the wall
act_setSpeed(&left, DRIVE_SPEED_MAX);
act_setSpeed(&right, DRIVE_SPEED_MAX);
act_setSpeed(&top, DRIVE_SPEED_MIN);
act_setSpeed(&bottom, DRIVE_SPEED_MIN);
}
void forward(void)
{act_setSpeed(&left, DRIVE_SPEED_MAX);
act_setSpeed(&right, DRIVE_SPEED_MIN);

}
void rotate(void)
{act_setSpeed(&left, DRIVE_SPEED_MAX);
act_setSpeed(&right, DRIVE_SPEED_MAX);
act_setSpeed(&top, DRIVE_SPEED_MAX);
act_setSpeed(&bottom, DRIVE_SPEED_MAX);

}

void appInitHardware(void){
distanceInit(IR1);
distanceInit(PINGsensor);


}
// This routine is called once to allow you to set up any other variables in your

// You can use 'clock' function here.
// The loopStart parameter has the current clock value in ?S
TICK_COUNT appInitSoftware(TICK_COUNT loopStart){
return 0; // dont pause after
}

TICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart){
distanceRead(IR1);
IR1.distance.cm(IR1read);
distanceRead(PINGsensor);
PINGsensor.distance.cm(PINGread);
{if (IR1read > 4)
{do
distanceRead(sensor);
IR1.distance.cm(IR1read);
away_from_wall();

while (IR1read > 4 && PINGread < 4);}}
{if (IR1read < 4)
{do
distanceRead(sensor);
IR1.distance.cm(IR1read);
towards_wall();

while (IR1read < 4 && PINGread < 4);}}
{if (IR1read == 4)
{do
distanceRead(sensor);
IR1.distance.cm(IR1read);
forward();

while (IR1read == 4 && PINGread < 4);}}
{if (PINGread < 4)
{do
distanceRead(PINGsensor);
PINGsensor.distance.cm(PINGread);
rotate();

while (PINGread < 100);}}

return (10); // wait for 1 second before calling me again. 1000000us = 1

}




also here is the makefile:


Code: [Select]
###############################################################################
# Makefile for the project omnibot_wall_follow
###############################################################################

## General Flags
PROJECT = omnibot_wall_follow
MCU = atmega640
TARGET = omnibot_wall_follow.elf
CC = avr-gcc.exe

## Options common to compile, link and assembly rules
COMMON = -mmcu=$(MCU)

## Compile options common for all C compilation units.
CFLAGS = $(COMMON)
CFLAGS += -Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d

## Assembly specific flags
ASMFLAGS = $(COMMON)
ASMFLAGS += $(CFLAGS)
ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2

## Linker flags
LDFLAGS = $(COMMON)
LDFLAGS +=  -Wl,-Map=omnibot_wall_follow.map


## Intel Hex file production flags
HEX_FLASH_FLAGS = -R .eeprom

HEX_EEPROM_FLAGS = -j .eeprom
HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load"
HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0 --no-change-warnings


## Objects that must be built in order to link
OBJECTS = omnibot_wall_follow.o PingSonar.o GP2D120.o

## Objects explicitly added by the user
LINKONLYOBJECTS =

## Build
all: $(TARGET) omnibot_wall_follow.hex omnibot_wall_follow.eep omnibot_wall_follow.lss size

## Compile
omnibot_wall_follow.o: ../omnibot_wall_follow.c
$(CC) $(INCLUDES) $(CFLAGS) -c  $<

PingSonar.o: ../webbotavrclib-1.14a/Sensors/Distance/Ping/PingSonar.c
$(CC) $(INCLUDES) $(CFLAGS) -c  $<

GP2D120.o: ../webbotavrclib-1.14a/Sensors/Distance/Sharp/GP2D120.c
$(CC) $(INCLUDES) $(CFLAGS) -c  $<

##Link
$(TARGET): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET)

%.hex: $(TARGET)
avr-objcopy -O ihex $(HEX_FLASH_FLAGS)  $< $@

%.eep: $(TARGET)
-avr-objcopy $(HEX_EEPROM_FLAGS) -O ihex $< $@ || exit 0

%.lss: $(TARGET)
avr-objdump -h -S $< > $@

size: ${TARGET}
@echo
@avr-size -C --mcu=${MCU} ${TARGET}

## Clean target
.PHONY: clean
clean:
-rm -rf $(OBJECTS) omnibot_wall_follow.elf dep/* omnibot_wall_follow.hex omnibot_wall_follow.eep omnibot_wall_follow.lss omnibot_wall_follow.map


## Other dependencies
-include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*)

« Last Edit: February 16, 2010, 09:27:01 AM by dellagd »
Innovation is a product of Failure, which leads to Success.

If I helped, +1 helpful pls

I Won!
3rd place! I'm taking $100

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: programming in AVR studio
« Reply #4 on: February 15, 2010, 06:29:25 PM »
If you add any C or H files to your project directory then AVRStudio doesn't really know about them.
On the left side of AVRStudio you should see a tree view called AVR GCC - if not then go to menu option View | Toolbars | AVR GCC to view it.

Opening the source and header option in this window shows the files that AVRStudio knows you need including. If any are missing then right click on either Source Files or Header Files to get a submenu.

Try using the Add Existing options if the file is in the folder but AVRStudio doesn't know about it . ie if you just use Windows Explorer to copy a file into your project then AVRStudio knows nothing about it unless you do the above to tell it about its existence.

May/MayNot be the answer to your problem

Following this route I have never had to use makefiles from AVRStudio
« Last Edit: February 15, 2010, 06:30:45 PM by Webbot »
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: programming in AVR studio
« Reply #5 on: February 15, 2010, 06:37:12 PM »
Double post - sorry

@Dellagd
That code will never compile under WebbotLib.
First of all you have a 'main' which is 'very bad' and will stop your compiled program from being built.
You also init your sensors EVERY time through the main loop.

You are missing the standard appInitHardware, appInitHardware and appControl functions - which replace main().

Suggest you take another look at the photovore example in the manual.


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

Offline dellagdTopic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 731
  • Helpful? 5
  • Come to the dark side... We have cookies!
    • Exodus Rocketry
Re: programming in AVR studio
« Reply #6 on: February 15, 2010, 07:26:04 PM »
really? main function = instant error?

I give up!
I cant find the problem!
here is the like to the whole AVR project file and all the source files if anyone could take a look at it and try to figure out what is wrong that would be GREAT!
http://dellarobotics.weebly.com/uploads/2/1/3/4/2134294/odee.zip
« Last Edit: February 15, 2010, 07:45:17 PM by dellagd »
Innovation is a product of Failure, which leads to Success.

If I helped, +1 helpful pls

I Won!
3rd place! I'm taking $100

Offline dellagdTopic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 731
  • Helpful? 5
  • Come to the dark side... We have cookies!
    • Exodus Rocketry
Re: programming in AVR studio
« Reply #7 on: February 15, 2010, 07:52:10 PM »
ok now I know something is seriously wrong.
I downloaded sample code from admin and it gave me 10 errors!
I'm just gonna uninstall AVR studio and WinAVR and just start from scratch sound good?
Innovation is a product of Failure, which leads to Success.

If I helped, +1 helpful pls

I Won!
3rd place! I'm taking $100

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: programming in AVR studio
« Reply #8 on: February 15, 2010, 08:12:42 PM »
hey Dellagd,
is that bits of WebbotLib pasted into a regular AVR Studio project?
don't go reinstalling AVR Studio. that is not the problem.

for WebbotLib throw away everything you know about microcontroller programming and start with a fresh mind.
there is a PDF manual in the WebbotLib file.
follow the example program there and it will start to become clear.

it's a bit of a shock to the system but worth the effort.


dunk.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: programming in AVR studio
« Reply #9 on: February 15, 2010, 08:25:01 PM »
Make sure you read the Getting Started With AVRStudio section of the manual ( this is a PDF file in the WebbotLib download ).
Then read the photovore example, (and others).
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: programming in AVR studio
« Reply #10 on: February 16, 2010, 12:07:11 AM »
It appears you are trying to program an Axon, right? Axon or Axon II?

Just follow the getting started tutorial step by step.

Which source code did you download?

Offline dellagdTopic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 731
  • Helpful? 5
  • Come to the dark side... We have cookies!
    • Exodus Rocketry
Re: programming in AVR studio
« Reply #11 on: February 16, 2010, 07:26:33 AM »
axon II examples.
the LED_Display one specifically
Innovation is a product of Failure, which leads to Success.

If I helped, +1 helpful pls

I Won!
3rd place! I'm taking $100

Offline dellagdTopic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 731
  • Helpful? 5
  • Come to the dark side... We have cookies!
    • Exodus Rocketry
Re: programming in AVR studio
« Reply #12 on: February 16, 2010, 07:42:46 AM »
ok, now I' m really confused.
I went into configuation options, changed nothing, went back to the program, clicked build, and the LED_display compiled!
so wierd...

EDIT: just tried again, and now the 10 errors are back!
« Last Edit: February 16, 2010, 07:53:27 AM by dellagd »
Innovation is a product of Failure, which leads to Success.

If I helped, +1 helpful pls

I Won!
3rd place! I'm taking $100

Offline dellagdTopic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 731
  • Helpful? 5
  • Come to the dark side... We have cookies!
    • Exodus Rocketry
Re: programming in AVR studio
« Reply #13 on: February 16, 2010, 08:16:54 AM »
I've been looking through the errors in my robots code and it seems like the computer thinks that the header files do not exist, even though they clearly do

can someone plz downoad from the link I posted and take a look at my code!
« Last Edit: February 16, 2010, 08:20:08 AM by dellagd »
Innovation is a product of Failure, which leads to Success.

If I helped, +1 helpful pls

I Won!
3rd place! I'm taking $100

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: programming in AVR studio
« Reply #14 on: February 16, 2010, 08:28:51 AM »
I'd bet its not working because as I can see here:
http://www.societyofrobots.com/robotforum/index.php?topic=10353.msg79213#msg79213

that you have not followed the Axon II setup instructions. ;D

For example, you haven't defined the clock speed, and optimization should be turned off. As such, I'm fairly sure you didn't define the WebbotLib folder :P

Offline dellagdTopic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 731
  • Helpful? 5
  • Come to the dark side... We have cookies!
    • Exodus Rocketry
Re: programming in AVR studio
« Reply #15 on: February 16, 2010, 08:48:44 AM »
did everything that the getting started part of the manual says, now I get 11 errors, and here they are:

Quote
Build started 16.2.2010 at 09:45:18
avr-gcc.exe  -mmcu=atmega640 -Wall -gdwarf-2 -std=gnu99       -DF_CPU=16000000UL -O0 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT omnibot_wall_follow.o -MF dep/omnibot_wall_follow.o.d  -c  ../omnibot_wall_follow.c
../omnibot_wall_follow.c:18: error: 'FLASE' undeclared here (not in a function)
../omnibot_wall_follow.c: In function 'appControl':
../omnibot_wall_follow.c:50: error: 'sensor' undeclared (first use in this function)
../omnibot_wall_follow.c:50: error: (Each undeclared identifier is reported only once
../omnibot_wall_follow.c:50: error: for each function it appears in.)
../omnibot_wall_follow.c:52: error: called object 'PINGsensor.distance.cm' is not a function
../omnibot_wall_follow.c:56: error: expected 'while' before 'IR1'
../omnibot_wall_follow.c:57: warning: implicit declaration of function 'away_from_wall'
../omnibot_wall_follow.c:63: error: expected 'while' before 'IR1'
../omnibot_wall_follow.c:64: warning: implicit declaration of function 'towards_wall'
../omnibot_wall_follow.c:70: error: expected 'while' before 'IR1'
../omnibot_wall_follow.c:71: warning: implicit declaration of function 'forward'
../omnibot_wall_follow.c:77: error: expected 'while' before 'PINGsensor'
../omnibot_wall_follow.c:78: warning: implicit declaration of function 'rotate'
../omnibot_wall_follow.c: At top level:
../omnibot_wall_follow.c:86: warning: conflicting types for 'away_from_wall'
../omnibot_wall_follow.c:57: warning: previous implicit declaration of 'away_from_wall' was here
../omnibot_wall_follow.c:94: warning: conflicting types for 'towards_wall'
../omnibot_wall_follow.c:64: warning: previous implicit declaration of 'towards_wall' was here
../omnibot_wall_follow.c:101: warning: conflicting types for 'forward'
../omnibot_wall_follow.c:71: warning: previous implicit declaration of 'forward' was here
../omnibot_wall_follow.c:106: warning: conflicting types for 'rotate'
../omnibot_wall_follow.c:78: warning: previous implicit declaration of 'rotate' was here
make: *** [omnibot_wall_follow.o] Error 1
Build failed with 9 errors and 12 warnings...

PS I am updating the code for this project up in my previous post
Innovation is a product of Failure, which leads to Success.

If I helped, +1 helpful pls

I Won!
3rd place! I'm taking $100

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: programming in AVR studio
« Reply #16 on: February 16, 2010, 09:02:11 AM »
Move your four custom functions that are at the bottom to above appInitHardware. That'll fix most of those errors.

And FLASE is spelled wrong :P

Offline dellagdTopic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 731
  • Helpful? 5
  • Come to the dark side... We have cookies!
    • Exodus Rocketry
Re: programming in AVR studio
« Reply #17 on: February 16, 2010, 09:09:13 AM »
thx admin, now I got these, which make no sense to me

Quote
Build started 16.2.2010 at 10:30:35
avr-gcc.exe  -mmcu=atmega640 -Wall -gdwarf-2 -std=gnu99         -DF_CPU=16000000UL -O0 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT omnibot_wall_follow.o -MF dep/omnibot_wall_follow.o.d  -c  ../omnibot_wall_follow.c
../omnibot_wall_follow.c: In function 'appControl':
../omnibot_wall_follow.c:76: error: called object 'IR1.distance.cm' is not a function
../omnibot_wall_follow.c:78: error: called object 'PINGsensor.distance.cm' is not a function
../omnibot_wall_follow.c:81: error: 'sensor' undeclared (first use in this function)
../omnibot_wall_follow.c:81: error: (Each undeclared identifier is reported only once
../omnibot_wall_follow.c:81: error: for each function it appears in.)
../omnibot_wall_follow.c:82: error: expected 'while' before 'IR1'
../omnibot_wall_follow.c:89: error: expected 'while' before 'IR1'
../omnibot_wall_follow.c:96: error: expected 'while' before 'IR1'
../omnibot_wall_follow.c:103: error: expected 'while' before 'PINGsensor'
make: *** [omnibot_wall_follow.o] Error 1
Build failed with 9 errors and 0 warnings...
it seems that errors 6,7,8,9 are all the same problem so 5 errors

I know I'm asking alot but I'm learning in the process :D
« Last Edit: February 16, 2010, 09:29:10 AM by dellagd »
Innovation is a product of Failure, which leads to Success.

If I helped, +1 helpful pls

I Won!
3rd place! I'm taking $100

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: programming in AVR studio
« Reply #18 on: February 16, 2010, 10:11:59 AM »
Look up in the WebbotLib manual how to read sensor data. You're using the wrong commands :P

For example, with the Ping, it should be this:

Code: [Select]
PingSonar sensor = MAKE_PingSonar(F0);//declare

distanceInit(sensor);//initialize

while(1)
{
distanceRead(sensor);//update value (do often)

do_something_useful(sensor.distance.cm);//use the sensor value to do something useful
}

Offline dellagdTopic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 731
  • Helpful? 5
  • Come to the dark side... We have cookies!
    • Exodus Rocketry
Re: programming in AVR studio
« Reply #19 on: February 16, 2010, 11:20:58 AM »
good news!
got it down to only 4 errors, basically all the same:

Quote
Build started 16.2.2010 at 11:31:39
avr-gcc.exe  -mmcu=atmega640 -Wall -gdwarf-2 -std=gnu99         -DF_CPU=16000000UL -O0 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT omnibot_wall_follow.o -MF dep/omnibot_wall_follow.o.d  -c  ../omnibot_wall_follow.c
../omnibot_wall_follow.c: In function 'set_integerIR1':
../omnibot_wall_follow.c:33: warning: type of 'IR1read1' defaults to 'int'
../omnibot_wall_follow.c: In function 'set_integerPING':
../omnibot_wall_follow.c:36: warning: type of 'PINGread1' defaults to 'int'
../omnibot_wall_follow.c: In function 'appControl':
../omnibot_wall_follow.c:88: error: expected 'while' before 'set_integerIR1'
../omnibot_wall_follow.c:95: error: expected 'while' before 'set_integerIR1'
../omnibot_wall_follow.c:102: error: expected 'while' before 'set_integerIR1'
../omnibot_wall_follow.c:109: error: expected 'while' before 'set_integerPING'
make: *** [omnibot_wall_follow.o] Error 1
fixed thoes errors, now I got this:
make: *** [omnibot_wall_follow.elf] Error 1

this also comes up under the "messages" tab:

gcc plug-in: Error: Object file not found on expected location C:\Documents and Settings\Griffin\My Documents\Robo stuff\ODEE\default\omnibot_wall_follow.elf

I realize that everything needs to be named correctly, and it is! please help!

edit: I updated the file link posted in an earlier post. plz take a look at it.
« Last Edit: February 16, 2010, 03:31:04 PM by dellagd »
Innovation is a product of Failure, which leads to Success.

If I helped, +1 helpful pls

I Won!
3rd place! I'm taking $100

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: programming in AVR studio
« Reply #20 on: February 17, 2010, 02:56:48 AM »
Quote
gcc plug-in: Error: Object file not found on expected location C:\Documents and Settings\Griffin\My Documents\Robo stuff\ODEE\default\omnibot_wall_follow.elf
On this page:
http://www.societyofrobots.com/axon/axon_getting_started_software.shtml
and
http://www.societyofrobots.com/axon2/axon2_setup1.shtml

you'll see:
Quote
Note: A common error you may get is

"gcc plug-in: Error: Object file not found on expected location C:\Documents and Settings\User\My Documents\My_Robots\[your project name]\[your project name].elf

Make sure your makefile specifies the output .elf file as [your project name].elf"

If you get that error, it means you made a mistake naming your files. Start at the beginning, and read instructions more carefully.
;D

A google search on 'gcc plug-in: Error: Object file not found on expected location' would have linked you to that :P

The specific step you missed is where you aren't allowed to have a space in the file name. For example, "Documents and Settings" has two spaces in it. I put my code in:
C:\My_Robots\Axon2_WebbotLib\photovore\

Its an AVR Studio/gcc feature (bug?) ;D

Offline dellagdTopic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 731
  • Helpful? 5
  • Come to the dark side... We have cookies!
    • Exodus Rocketry
Re: programming in AVR studio
« Reply #21 on: February 17, 2010, 06:00:25 AM »
now there are no spaces, same problem...
Innovation is a product of Failure, which leads to Success.

If I helped, +1 helpful pls

I Won!
3rd place! I'm taking $100

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: programming in AVR studio
« Reply #22 on: February 17, 2010, 06:06:39 AM »
Same error?

Are you absolutely sure you didn't miss a step?

Offline dellagdTopic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 731
  • Helpful? 5
  • Come to the dark side... We have cookies!
    • Exodus Rocketry
Re: programming in AVR studio
« Reply #23 on: February 18, 2010, 06:21:35 AM »
yes I am sure. There are no spaces in the name.
could someone plz download the project and try it on their pc? I really have no idea what is wrong and it might be obious once one of u try it :)
Innovation is a product of Failure, which leads to Success.

If I helped, +1 helpful pls

I Won!
3rd place! I'm taking $100

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: programming in AVR studio
« Reply #24 on: February 18, 2010, 08:09:57 AM »
yes I am sure. There are no spaces in the name.
could someone plz download the project and try it on their pc? I really have no idea what is wrong and it might be obious once one of u try it :)

Man - what a mess  :o

In your makefile you have
Code: [Select]
LIBDIRS = -L"C:\Documents and Settings\Griffin\My Documents\Robo stuff\webbotavrclib-1.14a"
So there are some spaces straight away.

Also you included all the source code for WebbotLib in your download !!
Your makefile then decides to compile some of my source files and also adds the pre-compiled '.a' library file.

The whole point of the library is that WebbotLib can live in its own folder (eg: C:\WebbotLib')
Your projects can live somewhere else entirely. By setting an 'include' option to point to C:\WebbotLib your build can find all of the .H files and the linker can bring in the .a file.  The .C files are only there for reference purposes.
By using the correct approach you can install a new version of WebbotLib and ALL of your projects will automatically use the new version (coz you haven't copied any files around).

Looking at your source file then:
1. You have defined the Sharp sensor on ADC0 and the Ping sensor on F0 - ie they are both on the same pin !
2. The warnings you are seeing that '... defaults to int' is because you are writing functions that take a parameter but you don't say what datatype it is. For example you have written:
Code: [Select]
void set_integerIR1(IR1read1)
{IR1read = IR1read1;}


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

Offline dellagdTopic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 731
  • Helpful? 5
  • Come to the dark side... We have cookies!
    • Exodus Rocketry
Re: programming in AVR studio
« Reply #25 on: February 18, 2010, 12:21:52 PM »
I havent fine tuned the project yet, like the same pin thing.
with the library in a different folder, I didn't know that I could do that! I'll be doing that from now on.
with the make file, I am not using it, I havent ticked the "use external makefile button" so it isnt using that makefile (or is it?)
I will change that filepath in the makefile for you, but I'm not sure thats the problem, but its a new thing to try :)

« Last Edit: February 18, 2010, 03:11:56 PM by dellagd »
Innovation is a product of Failure, which leads to Success.

If I helped, +1 helpful pls

I Won!
3rd place! I'm taking $100

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: programming in AVR studio
« Reply #26 on: February 18, 2010, 01:54:20 PM »
I will change that filepath in the makefile for you, but I'm not sure thats the problem, but its a new thing to try :)
It may not be - but when I loaded it into AVRStudio and fixed the problem as per point 2 of my previous email then it all compiled fine and with no warnings.

« Last Edit: February 18, 2010, 03:36:14 PM by Webbot »
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline dellagdTopic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 731
  • Helpful? 5
  • Come to the dark side... We have cookies!
    • Exodus Rocketry
Re: programming in AVR studio
« Reply #27 on: February 18, 2010, 03:20:27 PM »
I changed it to this
Code: [Select]
SERVO left = MAKE_SERVO(FALSE, E3,1500, 500);
SERVO right = MAKE_SERVO(FALSE , E4,1500, 500);
SERVO top = MAKE_SERVO(FALSE, E2,1500, 500);
SERVO bottom = MAKE_SERVO(FALSE , E1,1500, 500);
// Create the list - remember to place an & at the
// start of each servo name
SERVO_LIST servos[] = {&left,&right, &top, &bottom};
// Create a driver for the list of servos
SERVO_DRIVER bank1 = MAKE_SERVO_DRIVER(servos);
Sharp_GP2D12 IR1 = MAKE_Sharp_GP2D12(ADC0);
PingSonar PINGsensor = MAKE_PingSonar(F0);

int IR1read
int PINGread

void set_integerIR1(int IR1read1)
{IR1read = IR1read1;}

void set_integerPING(int PINGread1)
{PINGread = PINGread1; }


adding just an "int" before the varibles. since I'm not very good at programming though, I guessing something is still wron since I get 6 new errors :P
Innovation is a product of Failure, which leads to Success.

If I helped, +1 helpful pls

I Won!
3rd place! I'm taking $100

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: programming in AVR studio
« Reply #28 on: February 18, 2010, 03:50:38 PM »
Ok - final offer....

If you install WebbotLib by unzipping it to a given folder and let me know where it is. I'll assume its C:\WebbotLib unless you say otherwise.

Then tell me a directory of where you would like your AVRStudio to placed. I'll assume its C:\MyRobots\Omnibot unless you say otherwise.

Given that info - I will send you a ZIP file to unpack into that last folder eg C:\MyRobots\Omnibot which will compile.

Note that I'm doing this to get you started with WebbotLib. I wont auto magically fix your program to do what you wanted it to do!

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

Offline dellagdTopic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 731
  • Helpful? 5
  • Come to the dark side... We have cookies!
    • Exodus Rocketry
Re: programming in AVR studio
« Reply #29 on: February 18, 2010, 03:59:52 PM »
um, thx. I hope I'm not coming off as annoying because I just want to know how to solve this problem and make more future programs in AVR studio. The webbot lib folder is C:/Robo_stuff/~here you put the webbot lib folder(that webbotavrclib-1.14a)~ my AVR studio project file is in C:/Robo_stuff/ODEE/~here is the AVR project file~.

again I am not trying to annoy (and I am sorry if I am) you I'm just suprised that no one had this problem before :P
Innovation is a product of Failure, which leads to Success.

If I helped, +1 helpful pls

I Won!
3rd place! I'm taking $100

 


Get Your Ad Here