Author Topic: AVR Studio 4: error  (Read 8782 times)

0 Members and 1 Guest are viewing this topic.

Offline Hawaii00000Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 347
  • Helpful? 2
AVR Studio 4: error
« on: June 26, 2010, 04:37:28 PM »
I'm having some trouble with AVR Studio 4. I'm just working on getting my brand new Axon going but AVR Studio 4 quits when I create a new project an click "Finish." Is this because I moved the WinAVR files?
"God chose to make the world according to very beautiful mathematics."
-Paul Dirac
**************************************************************
Its Hawaii Five-O. Get it?

Offline dellagd

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 731
  • Helpful? 5
  • Come to the dark side... We have cookies!
    • Exodus Rocketry
Re: AVR Studio 4: error
« Reply #1 on: June 26, 2010, 07:18:14 PM »
have you tried reinstalling AVR Studio 4?

It cant hurt
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 Hawaii00000Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 347
  • Helpful? 2
Re: AVR Studio 4: error
« Reply #2 on: June 26, 2010, 08:05:12 PM »
I got it now. You have to let the WinAVR install in the default place. Now to compile...
"God chose to make the world according to very beautiful mathematics."
-Paul Dirac
**************************************************************
Its Hawaii Five-O. Get it?

Offline Hawaii00000Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 347
  • Helpful? 2
Re: AVR Studio 4: error
« Reply #3 on: June 26, 2010, 09:03:42 PM »
Its not compiling for me... here's the settings I have. Anyone know what went wrong?






















































« Last Edit: June 26, 2010, 09:05:35 PM by Hawaii00000 »
"God chose to make the world according to very beautiful mathematics."
-Paul Dirac
**************************************************************
Its Hawaii Five-O. Get it?

Offline dellagd

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 731
  • Helpful? 5
  • Come to the dark side... We have cookies!
    • Exodus Rocketry
Re: AVR Studio 4: error
« Reply #4 on: June 27, 2010, 07:05:53 AM »
Error messages?

Did you follow the 'getting started' section in Webbot lib EXACTLY?
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 Hawaii00000Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 347
  • Helpful? 2
Re: AVR Studio 4: error
« Reply #5 on: June 27, 2010, 10:06:42 AM »
Yeah I'm following the Axon "getting started" the best I can but getting plenty of errors.
"God chose to make the world according to very beautiful mathematics."
-Paul Dirac
**************************************************************
Its Hawaii Five-O. Get it?

Offline dellagd

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 731
  • Helpful? 5
  • Come to the dark side... We have cookies!
    • Exodus Rocketry
Re: AVR Studio 4: error
« Reply #6 on: June 27, 2010, 11:25:15 AM »
What were the error messages?

Can you please post your code?
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: AVR Studio 4: error
« Reply #7 on: June 27, 2010, 06:39:32 PM »
Also are you using Project Designer or just writing the code and configuring AVR Studio by hand?

Definitely need to see error messages and as 'dellagd' says a copy of your code would help track down your mistakes
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 Hawaii00000Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 347
  • Helpful? 2
Re: AVR Studio 4: error
« Reply #8 on: June 27, 2010, 10:10:08 PM »
It works with Webbot's sample "hello world," but not with the photovore code. Maybe I'm just copying the wrong code.
"God chose to make the world according to very beautiful mathematics."
-Paul Dirac
**************************************************************
Its Hawaii Five-O. Get it?

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: AVR Studio 4: error
« Reply #9 on: June 28, 2010, 06:17:11 AM »
I recently fixed a problem in the photovore code - which came about as one of the included files hand changed name.
Check your code against the latest in the online docs at http://webbot.org.uk/WebbotLibDocs/object.jsp?id=27787
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 dellagd

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 731
  • Helpful? 5
  • Come to the dark side... We have cookies!
    • Exodus Rocketry
Re: AVR Studio 4: error
« Reply #10 on: June 28, 2010, 06:21:38 AM »
using Admin's photovore code will not work because it is not adapted to webbot lib.
programming with webbot lib uses a different format.

(You must use Webbot's photovore code)
« Last Edit: June 28, 2010, 07:26:04 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: AVR Studio 4: error
« Reply #11 on: June 28, 2010, 06:58:12 AM »
My previous post makes the assumption that you are using the Photovore code that comes in the WebbotLib 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 Hawaii00000Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 347
  • Helpful? 2
Re: AVR Studio 4: error
« Reply #12 on: June 28, 2010, 09:32:40 AM »
I'm using the code in the Axon "getting started" tutorial which is all set up with WebbotLib so it should be the right code.
"God chose to make the world according to very beautiful mathematics."
-Paul Dirac
**************************************************************
Its Hawaii Five-O. Get it?

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: AVR Studio 4: error
« Reply #13 on: June 28, 2010, 11:38:54 AM »
I'm still not sure if you mean the one on the Society Of Robots website written by Admin - or the one in the WebbotLib documentation (ie the PDF or on my website at http://webbot.org.uk/WebbotLibDocs/object.jsp?id=27787)

If its Admins code then I cant help you - and vice versa. So please clarify.

Also - unless you say exactly what error messages you are getting then its hard for anyone to help you.
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 Hawaii00000Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 347
  • Helpful? 2
Re: AVR Studio 4: error
« Reply #14 on: June 28, 2010, 03:58:39 PM »
Admin converted his Axon "getting started" tutorial to webbotlib. Here's the link: http://www.societyofrobots.com/axon2/axon2_setup1.shtml
I can try and check the code today.
"God chose to make the world according to very beautiful mathematics."
-Paul Dirac
**************************************************************
Its Hawaii Five-O. Get it?

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: AVR Studio 4: error
« Reply #15 on: June 28, 2010, 04:50:29 PM »
Phew - after all these posts we finally get to know where your source code comes from.

Now all we need to know is what error you are getting - which I think we've asked for 3 times already so far. This is request number 4.
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 Hawaii00000Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 347
  • Helpful? 2
Re: AVR Studio 4: error
« Reply #16 on: June 28, 2010, 07:36:56 PM »
Sorry webbot
Here the code (different form the coding your earlier link):
Code: [Select]
/*************************************************************************
AXON AND AXON II CODE FOR WEBBOTLIB

Authored by John Palmisano of SocietyofRobots.com
in collaboration with Clive Webster of WebbotLib.

For more information, see:
http://www.societyofrobots.com/axon
http://www.societyofrobots.com/axon2
http://sourceforge.net/projects/webbotavrclib

2009

intended use for Axon and Axon II

instructions:
Read comments for explanation of all code.

appInitHardware() is for initiating the Axon.

appControl() is where your code goes. It is similar to control.c
for the original Axon code.

See hardware.h for defining your external hardware.
See sys/axon2.h in WebbotLib to change which pins are input and output.
*************************************************************************/


//allows for printing with features, but uses more memory
#define RPRINTF_FLOAT
#define RPRINTF_COMPLEX

//additional math capabilities
//#include <math.h>

//WebbotLib includes
//#include "sys/axon.h" //use for original Axon
#include "sys/axon2.h" //defines your MCU (change to axon.h if you use the original Axon)
#include "servos.h" //use for servos
#include "a2d.h" //use for ADC
#include "rprintf.h" //use for UART
#include "i2c_master.h" //use for I2C
//#include "buffer.h" //use for GPS and other serial stuff

//user includes
#include "hardware.h"


// In my initialising code - pass the list of servos to control
void appInitHardware(void)
{
//initialize UART ports (see hardware.h to change baud/names)
uartInit(GPS_UART, GPS_BAUD); //UART0
uartInit(USB_UART, USB_BAUD); //USB
uartInit(WIRELESS_UART, WIRELESS_BAUD); //UART2
uartInit(OTHER_UART, OTHER_BAUD); //UART3

// declare USB for output
rprintfInit(USB_ACTIVATE);

// Initialise the servo controller
servoPWMInit(&bank1); //use PWM to control servos (must use PWM pins!)
//servosInit(&bank1, TIMER1); //use software PWM to control servos (can use any pin)

// Initiate Sensors (examples commented out)
//accelerometerInit(accm3d2);
//compassInit(hmc6343);
//gyroInit(idg300);

}

TICK_COUNT appInitSoftware(TICK_COUNT loopStart){
rprintf("\nAxon Initiated.\n\n");
return 0;
}


//the larger this number, the more likely your robot will drive straight
#define threshold 8

// This is the main loop
TICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart)
{

servosDisconnect(&bank1);//turn servos off

delay_ms(100);//button debounce delay

rprintf("\nPush Button to Start\n");

while(!button_pressed());//wait for button to be pressed

servosConnect(&bank1);//turn servos on

delay_ms(100);//button debounce delay

while(!button_pressed())//exit code if button is pushed
{
update_sensors();

if(lightLeft > lightRight && (lightLeft - lightRight) > threshold)
{
// go left
act_setSpeed(&left_wheel,DRIVE_SPEED_MIN);
act_setSpeed(&right_wheel,DRIVE_SPEED_MAX);

led_put_char(1);
}

else if(lightRight > lightLeft && (lightRight - lightLeft) > threshold)
{
// go right
act_setSpeed(&left_wheel,DRIVE_SPEED_MAX);
act_setSpeed(&right_wheel,DRIVE_SPEED_MIN);

led_put_char(3);
}

else
{
// Go forwards
act_setSpeed(&left_wheel,DRIVE_SPEED_MAX);
act_setSpeed(&right_wheel,DRIVE_SPEED_MAX);

led_put_char(2);
}

//print out detected difference
rprintf("Sensor Difference: %d\n", lightLeft - lightRight);

delay_ms(30);//slow control loop down to prevent crazy robot oscillation
}

return 20000; // wait for 20ms to stop crazy oscillations (long story)
}

and here's the errors:
« Last Edit: June 28, 2010, 07:38:37 PM by Hawaii00000 »
"God chose to make the world according to very beautiful mathematics."
-Paul Dirac
**************************************************************
Its Hawaii Five-O. Get it?

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: AVR Studio 4: error
« Reply #17 on: June 28, 2010, 07:51:29 PM »
Your errors are caused by the first one ie that it cannot find 'hardware.h'

I think you've failed to add hardware.h as described in Step 6 of http://www.societyofrobots.com/axon2/axon2_setup1.shtml
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 dellagd

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 731
  • Helpful? 5
  • Come to the dark side... We have cookies!
    • Exodus Rocketry
Re: AVR Studio 4: error
« Reply #18 on: June 29, 2010, 06:37:38 AM »
if you have it, make sure it is in the same folder as the rest of your code (the .c file, excluding the webbot-lib stuff).
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 Hawaii00000Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 347
  • Helpful? 2
Re: AVR Studio 4: error
« Reply #19 on: June 29, 2010, 09:06:09 PM »
I did this-
Quote
Now, right click 'Header Files' and left click 'Add Existing Source File(s)...'. Add hardware.h from the photovore example folder.
I think that's what you mean.

if you have it, make sure it is in the same folder as the rest of your code (the .c file, excluding the webbot-lib stuff).


So have to save the whole thing in the same folder as the hardware.h? 
"God chose to make the world according to very beautiful mathematics."
-Paul Dirac
**************************************************************
Its Hawaii Five-O. Get it?

Offline dellagd

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 731
  • Helpful? 5
  • Come to the dark side... We have cookies!
    • Exodus Rocketry
Re: AVR Studio 4: error
« Reply #20 on: June 30, 2010, 06:21:04 AM »
not webbot lib, but all the unique code (not from webbot lib) must be contained in the same folder with the AVRstudio file as well.
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 Hawaii00000Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 347
  • Helpful? 2
Re: AVR Studio 4: error
« Reply #21 on: June 30, 2010, 11:15:38 AM »
Problem solved! :D Thanks for the help Webbot and dellagd. I appreciate you time.
"God chose to make the world according to very beautiful mathematics."
-Paul Dirac
**************************************************************
Its Hawaii Five-O. Get it?

Offline dellagd

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 731
  • Helpful? 5
  • Come to the dark side... We have cookies!
    • Exodus Rocketry
Re: AVR Studio 4: error
« Reply #22 on: June 30, 2010, 04:44:48 PM »
did what I said solve it? just for others it would be nice to say what fixed 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 Hawaii00000Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 347
  • Helpful? 2
Re: AVR Studio 4: error
« Reply #23 on: June 30, 2010, 04:54:01 PM »
did what I said solve it? just for others it would be nice to say what fixed it.

Yes, putting the hardware.h in the same folder as the rest of the files solved it.
"God chose to make the world according to very beautiful mathematics."
-Paul Dirac
**************************************************************
Its Hawaii Five-O. Get it?