Author Topic: Undefined reference to 'AVcc_MV'  (Read 1098 times)

0 Members and 1 Guest are viewing this topic.

Offline AligatorTopic starter

  • Jr. Member
  • **
  • Posts: 25
  • Helpful? 0
Undefined reference to 'AVcc_MV'
« on: January 13, 2011, 07:05:54 AM »
Hi

I am using webbotlib and webbotlib project designer for the first time and have written my code. (it is not the best, it is my way of teaching myself to use webbotlib, as well as the majority of C)

I am writing code for a object avoiding robot, using a Sharp IR, 2 continuous rotation servos, 1 servo for scanning(that i am not using in the original program) and the MCU is a mega328.

my problem is i am getting the error "/a2d.h:210 undefined reference to "AVcc_MV' "

my code is a as follows

Code: [Select]
#include "hardware.h"
#include "servos.h"


int speed;
int distanceRead;

// Initialise the hardware
void appInitHardware(void) {
initHardware();
}


// Initialise the software
TICK_COUNT appInitSoftware(TICK_COUNT loopStart){
return 0;
}

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

while(1);
{

if(distanceRead > 100)
{
act_setSpeed(&servo_left,50);
act_setSpeed(&servo_right,0);
}

else
{
act_setSpeed(&servo_left,50);
act_setSpeed(&servo_right,50);
}

delay_cycles(500);
}

return 0;

}

help as to what my problem might be and any suggestions when it comes to the writing of the program would be greatly appreciated.

thanks

Aligator

Offline Joker94

  • Supreme Robot
  • *****
  • Posts: 1,119
  • Helpful? 26
Re: Undefined reference to 'AVcc_MV'
« Reply #1 on: January 17, 2011, 07:24:36 PM »
I received the same error not to long ago but was unable to find a solution, so that program is yet to be tested.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,152
  • Helpful? 110
Re: Undefined reference to 'AVcc_MV'
« Reply #2 on: January 19, 2011, 10:29:51 AM »
The AVcc_MV should be present in the generated 'hardware.h' file. ie you should see something like the following somewhere in the file:-
Code: [Select]
// ----------- Define the ADC channels ----------
const uint8_t NUM_ADC_CHANNELS = 16;
const uint16_t PROGMEM AVcc_MV = 5000;

It represents the number of milliVolts present on the a2d reference voltage on the chip pin.

Project Designer gets this info from the Board design you are using. So when you created the Project did you base it on one of the supplied boards - or did you create your own board using Board Designer? If the second is true - then re-open your board design in Board Designer and make sure that in the top left of the window you have entered a voltage. If the first is true then which board did you base your project on?
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 AligatorTopic starter

  • Jr. Member
  • **
  • Posts: 25
  • Helpful? 0
Re: Undefined reference to 'AVcc_MV'
« Reply #3 on: January 24, 2011, 09:23:30 PM »
My board on the robot is a 328 based board with a 16Mhz crystal.

On the project designer i am using the a$50 robot board with 328 and i change the frequency in AVR studio in config options.

still have not had any luck. should i design my own board in board designer?

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,152
  • Helpful? 110
Re: Undefined reference to 'AVcc_MV'
« Reply #4 on: January 25, 2011, 01:16:29 PM »
Are the lines that I mentioned previously in the generated hardware.h file ?
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 AligatorTopic starter

  • Jr. Member
  • **
  • Posts: 25
  • Helpful? 0
Re: Undefined reference to 'AVcc_MV'
« Reply #5 on: January 25, 2011, 10:12:08 PM »
I got the first line but not the second consisting of

Code: [Select]
const uint16_t PROGMEM AVcc_MV = 5000;
What i did do was design my own board in the board designer and now it works just fine, the only problem i am having is my programming ability and getting used to the webbotlib functions.

Do you or any one else have any recommendations on good ways to develop my programming skills and help getting started with webbotlib?

thanks

Aligator

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,152
  • Helpful? 110
Re: Undefined reference to 'AVcc_MV'
« Reply #6 on: January 26, 2011, 02:41:08 PM »
Ok so problem sorted - now we need to fix your brain  :)

Other threads suggest links/books for general C programming - search within SoR or Google.

For WebbotLib - then read the manual  :D , especially the first few chapters, but post questions on SoR as it has the biggest community of WebbotLib users to answer your questions.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

 


Get Your Ad Here