Author Topic: Displaying Analog inputs  (Read 2196 times)

pacific

  • Jr. Member
  • **
  • Posts: 8
    • View Profile
Displaying Analog inputs
« on: January 14, 2015, 11:27:58 PM »
Dear SIr

I need to display 3 analog values on the main page of the webserver. Please guide me how to achieve this,
FYI we used SBC board around 6 years back and programming was very simple (php).
It looks that the programming has changed a lot  :-o. Please help

Thanks
Atif

modtro2

  • Administrator
  • Hero Member
  • *****
  • Posts: 564
    • View Profile
Re: Displaying Analog inputs
« Reply #1 on: January 18, 2015, 10:40:25 PM »
Hello Atif

I will send you the HTML code for a demo web page that displays the Analog values for 3 input port. On your HTML page, you use tags for displaying dynamic values. For details, see:
http://netcruzer.com/project-webserver-tags.html

I will try to get the Analog input tags completed by the end of this week. This will enable you to display analog input value by simply adding a "i" input tag to your HTML web page.

modtro2

  • Administrator
  • Hero Member
  • *****
  • Posts: 564
    • View Profile
Re: Displaying Analog inputs
« Reply #2 on: January 18, 2015, 10:49:52 PM »
Hello Atif

You can of course add any dynamic content to the source code by following the steps described in the <Stack API><HTTP2 Server><Features><Dynamic Variables> section of the "Microchip TCP/IP stack documentation".

You can download the "Microchip TCP/IP stack documentation" in pdf format, or in Windows Help File format (*.chm).

pacific

  • Jr. Member
  • **
  • Posts: 8
    • View Profile
Re: Displaying Analog inputs
« Reply #3 on: February 05, 2015, 10:53:39 PM »
Dear David
 
I tried the Stack API instructions but these are beyond my understanding as i am new to programming, as long as i remember it was pretty simple in PHP. any way i would require your help in guiding me how to program this device in such a way that i get my analog values scaled as per my requirement.
 
Looking forward for  your support

modtro2

  • Administrator
  • Hero Member
  • *****
  • Posts: 564
    • View Profile
Re: Displaying Analog inputs
« Reply #4 on: March 01, 2015, 05:37:41 PM »
Hello Atif

Sorry for long delay, but this required quite a bit more code than expected. It is nearly done. It will now be possible to configure each port (via web page, UDP or USB) to be Digitial input/Output, PWM output or ADC(analog) input. You will need to configure as analog input. For example, to configure port 1 as an analog input:
Code: [Select]
c1=an
Will update the Webserver Commands with the new commands.

The value of any port can be obtained via the "i" tag. So, to get value of port 1, use following tag:
Code: [Select]
#i1
Will update the Webserver Tags with the new commands.

To use this on your web page, simply add "~#i1~" to your web page, and the value of the analog input will be displayed.
« Last Edit: March 01, 2015, 05:39:16 PM by modtro2 »

pacific

  • Jr. Member
  • **
  • Posts: 8
    • View Profile
Re: Displaying Analog inputs
« Reply #5 on: August 01, 2015, 03:34:25 AM »
Hello David

I wasnt able to get the desired result from the program can you please help, i get the DEF error .
Can you please upload an index file so that i can see what mistake i have made.

I am really sorry for a delayed feedback as i wasnt able to work on this project due to some personal reasons

regard
Atif