Shop OBEX P1 Docs P2 Docs Learn Events
SERIN trouble newbie VB visual basic — Parallax Forums

SERIN trouble newbie VB visual basic

ArchiverArchiver Posts: 46,084
edited 2003-02-25 02:25 in General Discussion
i want to send a number or a string to the stamp from VB. i can
recieve data rather well, but the stamp doesnt seem to get what VB is
sending. i used the code from <http://www.picobay.com/VB.html> I
dont know what code is not working i would suspect somethings wrong
with the stamp code ?

VB code:
Private Sub cmd_send_Click()
If MSComm1.PortOpen Then
MSComm1.PortOpen = False
End If
MSComm1.PortOpen = True
Dim SerData As Integer
SerData = 21
MSComm1.Output = Str(SerData) & "!"
MSComm1.PortOpen = False
End Sub

Stamp code:

'{$STAMP BS2}
low 3
low 4
low 5
low 6

here:
TheData var Byte
SERIN 16,16468,[noparse][[/noparse]DEC TheData] 'read data into TheData
if TheData = 21 THEN turnon
goto here

turnon:
high 3
high 4
high 5
high 6
goto here

i also tried the wait statement from the manual:
TheData var Byte
SERIN 16,16468,[noparse][[/noparse]WAIT("21")] 'read data into TheData
if TheData = 21 THEN turnon

Comments

Sign In or Register to comment.