Using the Arduino Ethernet shield with AMICUS18 (Joint forum project?)


Closed Thread
Results 1 to 40 of 63

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,624

    Default Re: Using the Arduino Ethernet shield with AMICUS18 (Joint forum project?)

    Hi,
    Nice work! I'm glad the code is getting some use!

    I know very little about HTML and even less about JAVA Script (which I suspect is what Document.Write() is?

    However, doing document.write(AN2) where I'm guessing AN2 is a variable in you PBP (Proton) program probably isn't working the way you expect. For it to work the way you've coded it the PutStringInTxBuffer routine would need to be able to decode and understand Java Script, find AN2 and put its content, as a string into the buffer - that's obviously NOT how it works or is intended to work.

    Again, I'm very green on this HTML and JAVA stuff so I may be wrong but that's how I think it works.

    In PBP, to load a "value" from a variable into an array as a string you could use ArrayWrite, I'm not sure how to do that in Proton but I'm sure there's some ToStr or whatever.

    Does that make sense?

    /Henrik.

  2. #2
    Join Date
    Mar 2014
    Posts
    5

    Default Re: Using the Arduino Ethernet shield with AMICUS18 (Joint forum project?)

    it is ok, is ok! work fine...

    i will new stage , w5100 use with sd card, and screen any picture or complicate html pages. ty .. bye.




    this is code,
    '------------------------------------------------------------------------------------------------------------------------

    send_back_result:


    RequestCount = RequestCount + 1
    GoSub GetFreeTXSize
    TotalCount = 0

    Buffer = "HTTP/1.1 200 OK "+13+10+0
    GoSub PutStringInTXBuffer
    Buffer = "Content-Type:text/html"+13+10+13+10+0
    GoSub PutStringInTXBuffer

    '---------server side------------------------------------client side----------------------------------------------------

    If Buffer[5] = "s" Then '<--------------------- send me "s" block <script src=s></script>"


    Buffer = "var AN2=" ' <------------send me AN2 variable <script>document.write(AN2)</script
    GoSub PutStringInTXBuffer

    Buffer = "1977" '-------------------> put string "1977" or any string variable
    GoSub PutStringInTXBuffer

    Buffer = ";"
    GoSub PutStringInTXBuffer' -------------------> and put end of the string.

    EndIf

    '--------------------------------------- end of the cominicate

    WizPtr = WizPtr + TotalCount ' load others... end.


    WizAdress = W5100_S0_TX_WR0 : WizData = WizPtr.HighByte : GoSub Write_W5100
    WizAdress = W5100_S0_TX_WR1 : WizData = WizPtr.LowByte : GoSub Write_W5100

    ' Issue a SEND command.
    WizAdress = W5100_S0_CR : WizData = W5100_Sn_SEND : GoSub Write_W5100

    WaitForCompletion2:
    GoSub Read_W5100
    If WizData <> 0 Then GoTo WaitForCompletion2



    ' Then disconnect from the client.
    WizAdress = W5100_S0_CR : WizData = W5100_Sn_DISCON : GoSub Write_W5100

    ' And close the socket. We'll reopen the socket again in the main routine.
    WizAdress = W5100_S0_CR : WizData = W5100_Sn_CLOSE : GoSub Write_W5100

    GetRequest = 0




    Return

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts