[En-Nut-Discussion] sorry!(except file)

조상만 csmcho at postech.ac.kr
Tue Oct 29 20:25:56 CET 2002


 
Hi,

I would like to see temperatue with web and inserted ADC souce code into
httpd.c sample as below.

When I clicked sensor cgi part , I could see my result as below
 
00111000 0056 00111000 0056 00111000 0056 00111000 0056 
00111000 0056 00111000 0056 00111000 0056 00111000 0056
 00111000 0056...... -> infinite ^_^ 
(because of my infinite loop..)

Anyway it's ok.
 
0056*0.4 = 22.4 -> real temperature value.

Consequently, I would like to see not  infinite these values 
but temperature value only with constant interval(every 10sec).

For example, Temp:25'c
 
 
What can I do?




This is an inserted code in httped.c sample


static int ShowTemper(NUTDEVICE *sostream, REQUEST *req)
{
    unsigned char ADC_F7;
    int stat = -1;
    outp(0xff, DDRD);
    outp(0x07, ADMUX);
        
    NutHttpSendHeaderTop(sostream, req, 200, "Ok");
    NutHttpSendHeaderBot(sostream, "text/html", -1);

    NutPrintString_P(sostream, PSTR("<HTML>"
                                 "<HEAD>"
                                 "<TITLE>Show Temper</TITLE>"
                                 "</HEAD>"
                                 "<BODY>"));

for(;;)
{
outp(0xc6, ADCSR);
ADC_F7 = (inp(ADCL)>>2);
ADC_F7 = (inp(ADCH)<<6) | ADC_F7;

outp(ADC_F7, PORTD);
stat = inp(PIND);
NutPrintInteger(sostream, stat, 2, 8, FMTFLG_ZERO);
NutPrintString(sostream, "\r\n");
NutPrintInteger(sostream, stat, 10, 4, FMTFLG_ZERO);
NutPrintString(sostream, "\r\n");
}
NutPrintString(sostream, "None");
    NutPrintString(sostream, "</BODY>"
                          "</HTML>");
    NutPrintFlush(sostream);

    return 0;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.egnite.de/pipermail/en-nut-discussion/attachments/20021030/cd7a314f/attachment.html>


More information about the En-Nut-Discussion mailing list