Imports System.Threading
Imports System.IO
Imports System.Text
Imports System.IO.Ports
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i As String
Do
i = SerialPort1.ReadByte
RichTextBox1.Text = RichTextBox1.Text + "<" + Str(i) + ">"
RichTextBox1.Refresh()
TextBox1.Text = "Hellow World"
Loop While i <> 100
End Sub
Private Sub Form1_Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Disposed
If SerialPort1.IsOpen() Then
SerialPort1.Close()
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
SerialPort1.PortName = "Com5"
SerialPort1.Open()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox1.Text = "Hellow World"
End Sub
End Class
in my code,im inputting a byte coming from Arduino board microncontroller..im sending character 'N' to com5, and the code above is fetching that data from arduino board..my problem is the output string on the textbox is <78> which is the ASCII equivalent of 'N' how will i convert that to what is really being sent by the board which is 'N'..
anyone?..

New Topic/Question
Reply




MultiQuote




|