sending five variables

RickAlty

Senior Member
Ok, further to my LED driving project....

I have been able to get the serin to trigger selecting the right digits but only by sending (from the terminal in prog editor) the five variables one at a time. In other words, this....

serin 1,n2400,#b1
let b0 = b1
gosub test
serin 1,n2400,#b1
let b0 = b1
gosub test
serin 1,n2400,#b1
let b0 = b1
gosub test
serin 1,n2400,#b1
let b0 = b1
gosub test
serin 1,n2400,#b1
let b0 = b1
gosub test
goto main

works fine, but this...

serin 1,n2400,#b1, #b2, #b3, b4, #b5
let b0 = b1
gosub test
let b0 = b2
gosub test
let b0 = b3
gosub test
let b0 = b4
gosub test
let b0 = b5
gosub test
goto main

doesn't. Am I sending the data from the editor wrong? How do I send the five digit number as five seperate variables?

Richard
 

hippy

Technical Support
Staff member
You could try ...

serin 1,n2400,b1, b2, b3, b4, b5
let b0 = b1-"0" : gosub test
let b0 = b2-"0" : gosub test
let b0 = b3-"0" : gosub test
let b0 = b4-"0" : gosub test
let b0 = b5-"0" : gosub test
goto main
 

RickAlty

Senior Member
Thanks, Hippy.

I think the problem is in how I'm putting the five digit number into the terminal output buffer in the program editor. If I send this...

MSComm1.PortOpen = True
MSComm1.Output = Digit1.Text
MSComm1.Output = Digit2.Text
MSComm1.Output = Digit3.Text
MSComm1.Output = Digit4.Text
MSComm1.Output = Digit5.Text
MSComm1.PortOpen = False

from VB, then either one serin asking for #b1,#b2,#b3,#b4,#b5, or five seperate ones each asking for #b1 both work. From the editor terminal, though, I don't seem to be able to get it tosend five seperate variables.
 
Top