Shop OBEX P1 Docs P2 Docs Learn Events
Wifi+propeller — Parallax Forums

Wifi+propeller

hooktxuhooktxu Posts: 33
edited 2009-04-29 10:03 in Propeller 1
Has anyone used the Secure Socket iWiFi along with the propeller?
The problem is that it not leaves this loop:

i:= 0
repeat
serialPC.str(string("repeat"))
ppp:=serialIWi.rx
i++
while NOT(ppp[noparse][[/noparse]i-1]==$0D)
serialPC.str(@ppp[noparse][[/noparse]0])
serialPC.tx($0A)
serialPC.tx($0D)

Comments

  • AleAle Posts: 2,363
    edited 2009-04-29 08:57
    Please use the [noparse][[/noparse] code ] and [noparse][[/noparse] / code ] tags to delimit your code. Spin is indentation aware (like python). Without them we cannot see your code correctly.

    Por favor usa los tags [noparse][[/noparse] code ] and [noparse][[/noparse] / code ] (sin los espacios) para encerrar tu c
  • hooktxuhooktxu Posts: 33
    edited 2009-04-29 09:26
    -i:= 0
    -repeat
    ----serialPC.str(string("repeat"))
    ----ppp:=serialIWi.rx
    ----i++
    -while NOT(ppp[noparse][[/noparse]i-1]==$0D)

    -serialPC.str(@ppp[noparse][[/noparse]0])
    -serialPC.tx($0A)
    -serialPC.tx($0D)
  • AleAle Posts: 2,363
    edited 2009-04-29 09:54
    It may be ppp[noparse][[/noparse] i ] := seriallWi.rx

    The while should not be inside the repeat ?

    Edit: oh boy, the tag bite me :-(

    Post Edited (Ale) : 4/29/2009 10:34:55 AM GMT
  • KIHKIH Posts: 13
    edited 2009-04-29 10:03
    I see it this way.
    If "serialIWi.rx" returns a string, then you should read this before the loop.
    You catch a new string form the rx-buffer each time you "loop" and you have just luck if you hit the $0D

    Edit: If the "serialIWi.rx" only returns one char you don't save them in the position of variable "i" only in the first position..
    then i would use
    ppp[noparse][[/noparse] i ]:=serialIWi.rx
    



    Don't take my thinking as facit.. I'm also fresh with propeller

    Edit2: Using [noparse][[/noparse] i ] without spaces inside code don't work here.. rolleyes.gif

    Post Edited (KIH) : 4/29/2009 10:26:40 AM GMT
Sign In or Register to comment.