send ADC result from ethernet

General discussion on mikroBasic for dsPIC30/33 and PIC24.
Post Reply
Author
Message
crbn9
Posts: 38
Joined: 15 Apr 2008 19:25

send ADC result from ethernet

#1 Post by crbn9 » 28 May 2009 21:49

Hi all,

I'm trying to modify the example serial ethernet project in order to send only the result of ADC with TCP/IP. In fact, I'm trying to continuously sample the ADC and then send in on ethernet. For this aim, I tried to make a while loop for the part of the code as follow

Code: Select all

 while true
      temp = ADC_Read(2)
      WordToStr(temp, dyna)
      len1 = len1 + putString(dyna)
      Delay_ms(50)
      wend
But tyhe code compiled and did not work. How can I achieve this, please help...

Regards

User avatar
srdjan
mikroElektronika team
Posts: 1552
Joined: 28 Dec 2005 12:47
Location: Serbia

Re: send ADC result from ethernet

#2 Post by srdjan » 29 May 2009 08:57

Hi,
crbn9 wrote:Hi all,

I'm trying to modify the example serial ethernet project in order to send only the result of ADC with TCP/IP. In fact, I'm trying to continuously sample the ADC and then send in on ethernet. For this aim, I tried to make a while loop for the part of the code as follow

Code: Select all

 while true
      temp = ADC_Read(2)
      WordToStr(temp, dyna)
      len1 = len1 + putString(dyna)
      Delay_ms(50)
      wend
But tyhe code compiled and did not work. How can I achieve this, please help...

Regards
There is an http_demo example distributed with the compiler where pic acts as a server and sends adc converstion results to the browser.

crbn9
Posts: 38
Joined: 15 Apr 2008 19:25

#3 Post by crbn9 » 30 May 2009 05:18

Hi Srdjan,

Thank you for your answer. I investigated that example, but it sends lots of code over ethernet when it receives requests. I need to send the result of ADC without a request, like the ADC on UART1 example. How can I achieve this? Thank you again.

Regards

User avatar
srdjan
mikroElektronika team
Posts: 1552
Joined: 28 Dec 2005 12:47
Location: Serbia

#4 Post by srdjan » 03 Jun 2009 11:09

Hi,
crbn9 wrote:Hi Srdjan,

Thank you for your answer. I investigated that example, but it sends lots of code over ethernet when it receives requests. I need to send the result of ADC without a request, like the ADC on UART1 example. How can I achieve this? Thank you again.

Regards
Current ethernet library does not support tcp clients. We are working on this improvement. There is UDP client support implemented, so you can switch to using UDP if it suites your project.

User avatar
srdjan
mikroElektronika team
Posts: 1552
Joined: 28 Dec 2005 12:47
Location: Serbia

Re:

#5 Post by srdjan » 21 Dec 2011 13:59


Post Reply

Return to “mikroBasic for dsPIC30/33 and PIC24 General”