Jump to content
  • 0

Interfacing PMOD Wifi with PMOD ALS - Zedboard (Digilent)


Asha Devi

Question

Hi

I am trying to interface PMOD Wifi with PMOD ALS on a Digilent Zedboard. The idea is to display the ALS values on the HTML Page(default PinsPage.htm) every few seconds. I am stuck with the Application Code. I have checked the code which is used to read switches data to read the LED state and turn it on or off. Do I need to write code similar to that inorder to interface the ALS sensor and display its values on the HTML Page. Or is there any other method to achieve the same. Kindly suggest a way forward.

I've attached the block diagram for reference.

Thanks in advance.

Block_Diagram.jpg

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

Hi @Asha Devi,

Welcome to the Digilent forums!

You will need to incorporate the two libraries. I have not altered the Pmod WIFI example to work with another IP Core. I would first try using the Pmod WIFI example and alter it to use the ALS_read function from the Pmod ALS library . You will need to use the ALS_begin and initialize a PmodALS variable as well.  

best regards,

Jon

Link to comment
Share on other sites

Hi @jpeyron,

Apologies for the delayed response.

I have gone through the HTMLGetPins.cpp file and created a similar one for ALS called HTMLGetAls.cpp
I am getting few errors(please find the screenshot). 

These are the sequence of steps I've followed:

1. Created a GET request to PMODALs.htm (A dynamically generated page, similar to PinsPage.htm)
   " static const char szHTMLGetPMOD[]       = "GET /PMODALS.htm "; " in deWebIOServerSrc.cpp

2. Add HTML Page using the existing function (similar to ComposeHTMLGetPINS)
  " AddHTMLPage(szHTMLGetPMOD,     ComposeHTMLGetALS); "  in deWebIOServerSrc.cpp

3. Created HTMLGetAls.cpp to get ALS data (light value).

 

Attached Files Content:

1. HTMLGetAls.cpp - cpp file to read als data and display on web page(auto refresh every few seconds)
2. HTMLGetPins.cpp - auto generated cpp file. I've used this file as a reference to create HTMLGetAls.cpp
3. deWebIOServerSrc.cpp - controls the entire flow of the process
4. HTTPServer.h - contains the structure CLIENTINFO_T which controls the sequence of events
5. PmodALS.c - Used for ALS
6. PmodALS.h - Used for ALS

 

Thanks for support.

 

Regards,
Asha Devi

Errors.jpg

HTMLGetAls.cpp HTMLGetPins.cpp deWebIOServerSrc.cpp HTTPServer.h PmodALS.c PmodALS.h

Link to comment
Share on other sites

Hi @Asha Devi,

Thank you for sharing the source and the screenshot. The errors you are seeing say that there are multiple definitions of the ComposeHTMLGetALS function. That is happening because you are including HTMLGetals.cpp in deWebIOServerSrc.cpp. You can fix this by removing #include "./HTMLGetals.cpp" and writing a ComposeHTMLGetALS function declaration in deWebIOServerSrc.cpp or (better yet) a HTMLGetals.h header file that gets included into deWebIOServerSrc.cpp.

AndrewHolzer

Link to comment
Share on other sites

On 9/21/2019 at 1:52 AM, AndrewHolzer said:

Hi @Asha Devi,

Thank you for sharing the source and the screenshot. The errors you are seeing say that there are multiple definitions of the ComposeHTMLGetALS function. That is happening because you are including HTMLGetals.cpp in deWebIOServerSrc.cpp. You can fix this by removing #include "./HTMLGetals.cpp" and writing a ComposeHTMLGetALS function declaration in deWebIOServerSrc.cpp or (better yet) a HTMLGetals.h header file that gets included into deWebIOServerSrc.cpp.

AndrewHolzer

Hi AndrewHolzer,

 

Doing the above worked for me. Thanks a ton!

 

Regards,
Asha Devi

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...