Buy an Axon, Axon II, or Axon Mote and build a great robot, while helping to support SoR.
0 Members and 1 Guest are viewing this topic.
int findarea(int x, int y);TICK_COUNT appInitSoftware(TICK_COUNT loopStart){blaahahahahh long code that workssome code that determines y_final and x_finaldisplayGoto(&LCD,0,3); rprintf("area %d",findarea(x_final,y_final));}//--------------functions----------------------------------int findarea(int x, int y){return x + y;}
Now seems to be to do with 'Tank steering' and may not necessarily be anything to do with WebbotLib
more like just trying to get my my feet wet with functions and i thought this would a good challenge
My guess is that you can use the function: rprintfFloat, but I believe you will need to define #define RPRINTF_FLOATbefore the rprintf.h file is included...
I don't think he put any support into the actual rprintf function itself to support floating point.
Personally I prefer to avoid floating point. Instead I usually try to go to some fixed point version. For example if I were working with displaying the current battery voltage in 10ths of a degree I would keep the value as an integer where for example the value 62 would refer to 6.2 volts. If on my remote I wish to display this, I currently simply display it as 62 (different processor... and I was lazy), but if I wanted to display it as 6.2 I could probably do something like:rprintf("%2d.%1d", volts/10, volts%10);
rprintf("%2d.%1d", degrees/100, degrees%100);
rprintf("%d.%d", degrees/100, degrees%100);
warning: implicit declaration of function 'rprintfFloat'