SEROUT Command to PINK (Parallax Internet Network Kit)
DosEdge
Posts: 33
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,[noparse][[/noparse]"!NB0Wi:",DEC Update,CLS]
DEBUG· DEC Update,CR
NEXT
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,[noparse][[/noparse]"!NB0Wi:",DEC Update,CLS]
DEBUG· DEC Update,CR
NEXT
Comments
In your code, the "i" was being sent as a literal, rather than a value.
-Phil
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.
Trust me: you won't have to hard code anything. The loop will work.
-Phil
FOR·i·=·0·TO·11
··READ·i,·Update
··SEROUT·0,·396,·[noparse][[/noparse]"!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?
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
Thank You for your help so far,
DosEdge
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support