Sending Text to STAMP from VB.NET
Hello all,
Connecting to my STAMP via VB.NET 2008 and sending commands to turn on, off and other LCD commands seems to be easy, but how do I send text from my VB app to the LCD screen? When I try to send say "Hello" to the STAMP, all that gets delivered to the LCD screen is "H". STAMP code and VB code is as follows:
' {$STAMP BS2}
' {$PBASIC 2.5}
Input_Pin····· CON··· 0
BAUDMODE··· CON·· 32
Command···· VAR·· Word
LcdOn········ CON·· $16
LcdBLOn······CON·· $11
LcdBLOff····· CON·· $12
LcdClear····· CON·· $0C
Setup:
HIGH Input_Pin
PAUSE 100
Main:
· DO
·· GOSUB GetInput
·· LOOP
·· END
GetInput:
SERIN 16,16780,[noparse][[/noparse]Command]
'Send Input to LCD Screen
SEROUT Input_Pin,BAUDMODE,[noparse][[/noparse]LcdBLOn]··'Turn LCD Backlight On
PAUSE 100
SEROUT Input_Pin,BAUDMODE,[noparse][[/noparse]Command] 'Actual Input from VB.NET
PAUSE 3000
SEROUT Input_Pin,BAUDMODE,[noparse][[/noparse]LcdClear]· 'Clear LCD Screen
PAUSE 5
SEROUT Input_Pin,BAUDMODE,[noparse][[/noparse]LcdBLOff]· 'Turn LCD Backlight Off
PAUSE 5
RETURN
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visual Studio 2008 VB Side
Public Class Form1
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim MSG As String = TextBox1.Text
If SPort.IsOpen Then
····· SPort.WriteLine(MSG)
Else
····· MsgBox("No connection")
End If
End Sub
End Class
Any help would be greatly appreciated. Thank you!
Connecting to my STAMP via VB.NET 2008 and sending commands to turn on, off and other LCD commands seems to be easy, but how do I send text from my VB app to the LCD screen? When I try to send say "Hello" to the STAMP, all that gets delivered to the LCD screen is "H". STAMP code and VB code is as follows:
' {$STAMP BS2}
' {$PBASIC 2.5}
Input_Pin····· CON··· 0
BAUDMODE··· CON·· 32
Command···· VAR·· Word
LcdOn········ CON·· $16
LcdBLOn······CON·· $11
LcdBLOff····· CON·· $12
LcdClear····· CON·· $0C
Setup:
HIGH Input_Pin
PAUSE 100
Main:
· DO
·· GOSUB GetInput
·· LOOP
·· END
GetInput:
SERIN 16,16780,[noparse][[/noparse]Command]
'Send Input to LCD Screen
SEROUT Input_Pin,BAUDMODE,[noparse][[/noparse]LcdBLOn]··'Turn LCD Backlight On
PAUSE 100
SEROUT Input_Pin,BAUDMODE,[noparse][[/noparse]Command] 'Actual Input from VB.NET
PAUSE 3000
SEROUT Input_Pin,BAUDMODE,[noparse][[/noparse]LcdClear]· 'Clear LCD Screen
PAUSE 5
SEROUT Input_Pin,BAUDMODE,[noparse][[/noparse]LcdBLOff]· 'Turn LCD Backlight Off
PAUSE 5
RETURN
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visual Studio 2008 VB Side
Public Class Form1
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim MSG As String = TextBox1.Text
If SPort.IsOpen Then
····· SPort.WriteLine(MSG)
Else
····· MsgBox("No connection")
End If
End Sub
End Class
Any help would be greatly appreciated. Thank you!
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
Command VAR Byte(10)
SERIN RX,baud,[noparse][[/noparse]STR Command\5]
SEROUT Input_Pin,BAUDMODE,[noparse][[/noparse]STR Command\5] 'Actual Input from VB.NET
it has to be close
Jeff T.
Thanks but nope. That didn't work either. Whatever I type into the text box on the VB side, only the first character get's transmitted to the LCD screen on the stamp. I guess I need to figure out how to do the "Array" thing on the VB side or STAMP side or both.
Jeff T.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering