PDA

View Full Version : SEROUT Command to PINK (Parallax Internet Network Kit)



DosEdge
02-06-2007, 03:32 AM
I am trying to send repetitive information to the PINK.· Below is the portion that I am trying to use to do it.

The code· increments through the EEPROM (0-11) receiving the data,then sends it to the PINK's variables to be displayed in a web page through the SEROUT command through each iterations.

FOR i=0 TO 11
READ i, Update
SEROUT 0,396,["!NB0Wi:",DEC Update,CLS]
DEBUG· DEC Update,CR
NEXT

Phil Pilgrim (PhiPi)
02-06-2007, 03:41 AM
Try this instead:




FOR i = 0 TO 11
READ i, Update
SEROUT 0, 396, ["!NB0W", DEC i, ":", DEC Update, CLS]
DEBUG DEC Update, CR
NEXT





In your code, the "i" was being sent as a literal, rather than a value.

-Phil

DosEdge
02-06-2007, 07:32 AM
Phil Pilgrim

The code does not transfer the content in the EEPROM to the PINK. Instead, it sends the loop iteration value. I declared all PINK's variable in the html <Nb_var0> - <Nb_var11>. I receive the results 0 0. Think I will have to hardcode the program with twelve SEROUT commands to send the content to each of the PINK variable using a modulus position inside a for loop.

Phil Pilgrim (PhiPi)
02-06-2007, 07:55 AM
I just referred to the manual, and it looks like the leading zero in the variable designator is necessary. So try this instead:




FOR i = 0 TO 11
READ i, Update
SEROUT 0, 396, ["!NB0W", DEC2 i, ":", DEC Update, CLS]
DEBUG DEC Update, CR
NEXT




Trust me: you won't have to hard code anything. The loop will work.

-Phil

DosEdge
02-06-2007, 08:03 AM
PhilPhi, Can you explain to me what is going on inside the brackets?

DosEdge
02-06-2007, 09:19 AM
PhilPi
FOR·i·=·0·TO·11
··READ·i,·Update
··SEROUT·0,·396,·["!NB0W",·DEC2·i,·":",·DEC·Update,·CLS]
··DEBUG·DEC·Update,·CR
NEXT


DEC2 formatter designate that value of i sould be two digits.· Once I hardcode the twelve variables in the html page, will the BS2 use the loop with the SEROUT command to send the content of twelve positions in the EEPROM (0-11) to the those twelve variables in the html page.· Why did you separate the command in the brackets?

Phil Pilgrim (PhiPi)
02-06-2007, 09:48 AM
If you want to see firsthand what the formatting does, try this:




DEBUG CR
FOR i = 0 TO 11
READ i, Update
SEROUT 16, 84, ["!NB0W", DEC2 i, ":", DEC Update, CR]
NEXT




This will print the same data to the debug window that the PINK would see, except that each line ends with a CR, rather than a CLS, so you can see all the output. Hopefully, seeing it in action will make everything clear.

-Phil

DosEdge
02-06-2007, 10:13 AM
Phil Pilgrim I do not have access to the internet at home, so I will go examine the example that you have given me. If I have any other questions. I will PM to ask or not I will continue with this post.

Thank You for your help so far,

DosEdge

DosEdge
02-07-2007, 12:57 AM
The code works PhilPi! Thank you so much! Do you have any experience with the SLEEP command and the DS1620 thermometer sensor?

Chris Savage
02-07-2007, 01:37 AM
Please start a new thread for a different subject. Thanks!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support