Writing values ??to the ethernet shield

Hello I would like to help solve the problems with decimal numbers to ENC28J60 webserver.
In this code I'm writing just integers.

#define BUFFER_SIZE 550
static uint8_t buf[BUFFER_SIZE+1];
char numstr_a[1];
char numstr_b[1];
char numstr_c[1];
char numstr_d[1];
char numstr_e[1];
char numstr_f[1];
float average_x;
float average_y;
float average_z;
float average_u;
float j;
boolean gotIp = false;

EtherShield es=EtherShield(); //Inicializace ethernet shield

uint16_t http200ok(void)
{ return(es.ES_fill_tcp_data_p(buf,0,PSTR("HTTP/1.0 200 OK\r\nContent-Type: text/html\r\nPragma: no-cache\r\n\r\n")));
}

// prepare the webpage by writing the data to the tcp send buffer
uint16_t print_webpage(uint8_t *buf)

{ uint16_t plen;

plen=http200ok();

plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("Napeti na panelech: ")); // input A0 Nap?tí na panelech
itoa(analogRead(A0)/100,numstr_a,10); // convert integer to string
{plen=es.ES_fill_tcp_data(buf,plen,numstr_a); //writing values ??to the web
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR(" V
") //zápis veli?iny

I would use the command string to me it listed values ??beyond the decimal point. Pr it works patch from this page. But I do not know how to create syntax.

http://www.timewasters-place.com/arduino-string-and-float/

Thank you for your help with the syntax and the draft code. Alternatively, for advice on how to solve the problem without the patch.
PS. Excuse my Englis :expressionless:

char numstr_a[1];
char numstr_b[1];
char numstr_c[1];
char numstr_d[1];
char numstr_e[1];
char numstr_f[1];

Arrays that can hold one element are useless. You might as well be using scalar variables (non-arrays).

{     return(es.ES_fill_tcp_data_p(buf,0,PSTR("HTTP/1.0 200 OK\r\nContent-Type: text/html\r\nPragma: no-cache\r\n\r\n")));
}

NOTHING goes after the {!

   itoa(analogRead(A0)/100,numstr_a,10);                    // convert integer to string

It will NOT fit! The analogRead() function can return a value as large as 1023. Dividing that by 100 will result in a value between 0 and 10. That will require at least a 3 element buffer - not a 1 element buffer.

I would use the command string to me it listed values ??beyond the decimal point.

An integer divided by an integer is an integer. There are no values beyond the (non-existent) decimal point.

Even if you change the division operation to divide by 10.0, the resulting float will be truncated to an int when you pass it to a function (itoa()) that expects an int.

Hello
So pick up a field value to 3, reduce the value of the division (I need to have information about 9V at intersections such as 9V 8.9 V, 9.1 V, etc. - electronically edit it is not a problem) but with the transfer nevím.Co propose to show? Change the itoa for ..... Please Consult :relaxed:

So pick up a field value to 3, reduce the value of the division (I need to have information about 9V at intersections such as 9V 8.9 V, 9.1 V, etc. - electronically edit it is not a problem) but with the transfer nevím.Co propose to show? Change the itoa for ..... Please Consult

Perhaps what you need to consult is someone who speaks English.

Yes I apologize for my English helps me google translator. I need help converting to be able to display values ??for decimal point.
It is suitable for this use the patch to the string value, and how.
Or any other solution? Please be sure to write me a code example that would work. Thank you.

I need help converting to be able to display values ??for decimal point.

Need help converting what? The output from analogRead()? If so, I already gave you a hint:
analogRead(A0)/100.0

But, having done that, you can't use itoa() (Integer to ASCII) to deal with the float. You then need to use ftoa() (Float to ASCII).

Thank you very much for the idea, I will test and get back to :wink:

Good day
So I tried the FTOA but it gives an error.
This is what I wrote in row

plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("Napeti na panelech: "));
ftoa(analogRead(A0)/100,numstr_a,10);

Shows me this error.
solarserver1.cpp: In function 'uint16_t print_webpage(uint8_t*)':
solarserver1:42: error: 'ftoa' was not declared in this scope

Please how do I make syntax of that error was removed?

Perhaps you could use dtostrf(), instead.