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

Alastair Jeremy ajeremy at dotaussie.com.au
Tue Oct 29 22:50:02 CET 2002


Write the program on the Ethernut to return the temperature ONCE only in a
HTML page that has a REFRESH tag up the top of it. Then the browser will
request the page every 10 seconds, updating the page with the current
temperature.

Alastair

  -----Original Message-----
  From: en-nut-discussion-admin at egnite.de
[mailto:en-nut-discussion-admin at egnite.de]On Behalf Of 조상만
  Sent: Wednesday, 30 October 2002 6:26 AM
  To: en-nut-discussion at egnite.de
  Subject: [En-Nut-Discussion] sorry!(except file)



  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/9b2e3a60/attachment-0001.html>


More information about the En-Nut-Discussion mailing list