Society of Robots - Robot Forum

Software => Software => Topic started by: Cristi_Neagu on April 13, 2010, 01:12:50 PM

Title: Webbot's Project designer
Post by: Cristi_Neagu on April 13, 2010, 01:12:50 PM
First, let me just say that the idea is just brilliant. Not only does it reduces the time needed to program hardware to about 10% (i need to configure 30+ IO's for my project), but, since my Axon hasn't arrived yet, i can already start planning where each i/o plugs in to where, according to the layout of different boards inside my robot.

But, now to the question: when i click on generate (i must specify that i have no errors in the layout), does the code that project designer outputs is ready to be compiled? I mean, i know it's just a demo in the sense that "you connected a LED at this port, here's how you can control it via PWM".
So i went and added a simple LED on an AxonII, on port B4. Saved the design, and clicked on "Generate...". The thing is that when i try to compile the code with AVR studio i get all sorts of errors (18 errors and 16 warnings, most of them in hardware.h and xhardware.h). I specified the path to the Webbot library, also i made sure that the library is correctly installed in project->configuration options.

I attached the files resulted from project designer. Any ideas?

Anyways.... it's still a great piece of software ;D
Title: Re: Webbot's Project designer
Post by: Cristi_Neagu on April 14, 2010, 08:07:46 AM
Anyone?
Title: Re: Webbot's Project designer
Post by: madsci1016 on April 14, 2010, 02:53:01 PM
I can compile for files just fine as long as I comment out this section
Code: [Select]
// -------- Start Analogue Input-------
// Read the Analogue Input and store results
uint16_t adc0val = a2dConvert10bit(adc0);
// Dump out the value
rprintf("adc0: %d\n",adc0val);
// -------- End   Analogue Input-------

// -------- Start Generic PWM-------
// The current duty cycle can be read as follows:-
DUTY_CYCLE duty = pwmGetDutyCycle(led);

// Or it can be set to 75% using
duty = 75;
pwmSetDutyCycle(led, duty);

I don't know what you are trying to do there or how to do it, but everything else compiles fine.

Are you sure you have the latest lib version? The project designer auto-updates, your lib does not. So if you don't stay on top of keeping your lib up-to-date, you will have compile issues.
Title: Re: Webbot's Project designer
Post by: Cristi_Neagu on April 14, 2010, 03:16:53 PM
Thanks for the reply.

I updated the library (turns out i had version 1.13 - i made a mental note to feel stupid about that later). Now i get only 6 errors, but at least i get no more error related to the hardware header files - they are all located in test.c, in the section that you posted.

The main .c file is generated automatically by Project Designer, so i'm not actually trying to do anything in there :P. Now that i look closer at the code, it's clear that it is not meant to be used as is, but just as a guide. Or probably that Webbot still needs to tie up some loose ends here and there. But, anyways, the fact that the .c file doesn't compile is irrelevant because Project Designer is meant to create working hardware header files, which i see it does.

Thanks again for the reply.
Title: Re: Webbot's Project designer
Post by: Webbot on April 14, 2010, 05:51:34 PM
The first time you 'Generate' a project then you get a complete set of code that will compile - with NO errors. Including an AVR Studio project file if you are running on Windows.

Subsequent generations will not overwrite your main loop - as thats where you may have added your own code. But it will generate a file called example.txt instead - which is the equivalent of your main loop code if it was starting from scratch.
Title: Re: Webbot's Project designer
Post by: madsci1016 on April 14, 2010, 07:16:39 PM
@Webbot - This is a good example of what I predicted would happen. Any chance you will reconsider a pop-up when the designer auto-updates?
Title: Re: Webbot's Project designer
Post by: Webbot on April 14, 2010, 08:33:42 PM
@Webbot - This is a good example of what I predicted would happen. Any chance you will reconsider a pop-up when the designer auto-updates?

Nope - its beyond my control.  Auto-update just happens 'silently' within Java - ie my code doesn't even know its happened nor is it involved in the update process. So Project Designer does an 'auto update' - which is great

There are 2 variables here - the version of Project Designer (always the latest-automatic download) and the version of WebbotLib (not always the latest - ie a manual download).

EDIT: It would be great if WebbotLib also auto-updated - but it can't. The main reason being that it never 'executes' - its just a collection of files that you can unzip anywhere you like. So Project Designer etc cant even interrogate your latest version as it has no idea where it might be.

I will try to make the codegen process in Project Designer write a comment about the expected WebbotLib version.

Versions of WebbotLib don't come out every day - so if you get problems then check your WebbotLib version.

EDIT: This is a 'non-problem' as I see it. After all the first thing we would say is 'are you on the latest WebbotLib - if not then upgrade'.

Title: Re: Webbot's Project designer
Post by: Webbot on April 14, 2010, 09:26:11 PM
@Christi
As a 'catch all' then if you haven't added any code to the main loop-ie you are still playing with Project Designer-then all of the code in the destination folder can be deleted (except your Project file *.prj)
Title: Re: Webbot's Project designer
Post by: Cristi_Neagu on April 14, 2010, 11:58:23 PM
Thanks for the replies.

I just realized why I was still getting errors after i updated the library. I failed to realize that when i re-generated the project, the .c file remained unchanged, thus using calls and variables from the old library. All works now. But i do still get an warning when i compile in avr studio anything for the Axon board (the Axon II works ok):

Code: [Select]
../hardware.h:59: warning: passing argument 2 of '_uartInit' makes integer from pointer without a cast
line 59 of hardware.h is:

Code: [Select]
// ----------- Initialise built in devices ------
void sysInitHardware(void){
SWITCH_init(&button);
setErrorLog(&uart1SendByte);
rprintfInit(&uart1SendByte);
uartInit(uart1,null);    <-line 59
}

It compiles ok, but being new to this, i don't know how serious this warning is.

In conclusion, when my programs stop compiling, i'll update the library. Thanks for the help, guys ;D

Title: Re: Webbot's Project designer
Post by: Webbot on April 15, 2010, 08:22:03 AM
Its because you haven't specified a baud rate for UART1.
So in Project Designer - open up the uart and set up a baud rate.
Regenerate - and all should be ok
Title: Re: Webbot's Project designer
Post by: Cristi_Neagu on April 15, 2010, 09:06:41 AM
Its because you haven't specified a baud rate for UART1.
So in Project Designer - open up the uart and set up a baud rate.
Regenerate - and all should be ok

Yup, that was it. Thanks ;D